@@ -44,8 +44,16 @@ and we'll also have a discussion about how many tests are "enough".
44
44
45
45
=== Using Our Auth Backend in the Login View
46
46
47
- image::images/21in01.png[]
48
-
47
+ [role="scratchpad"]
48
+ *****
49
+ * _[strikethrough line-through]#Token model with email + uid#_
50
+ * _[strikethrough line-through]#_view to create token + send login email incl. url w/ token uid#_
51
+ * _[strikethrough line-through]#Custom user model with USERNAME_FIELD=email#_
52
+ * _[strikethrough line-through]#Authentication backend with authenticate() and get_user() functions#_
53
+ * _Register auth backend in settings.py_
54
+ * _login view calls authenticate() and login() from django.contrib.auth_
55
+ * _logout view calls django.contrib.auth.logout_
56
+ *****
49
57
50
58
We got our auth backend ready in the last chapter,
51
59
now we need use the backend in our login view.
@@ -68,8 +76,16 @@ AUTHENTICATION_BACKENDS = [
68
76
69
77
That was easy!
70
78
71
- image::images/21in02.png[]
72
-
79
+ [role="scratchpad"]
80
+ *****
81
+ * _[strikethrough line-through]#Token model with email + uid#_
82
+ * _[strikethrough line-through]#_view to create token + send login email incl. url w/ token uid#_
83
+ * _[strikethrough line-through]#Custom user model with USERNAME_FIELD=email#_
84
+ * _[strikethrough line-through]#Authentication backend with authenticate() and get_user() functions#_
85
+ * _[strikethrough line-through]#Register auth backend in settings.py#_
86
+ * _login view calls authenticate() and login() from django.contrib.auth_
87
+ * _logout view calls django.contrib.auth.logout_
88
+ *****
73
89
74
90
Next let's write some tests for what should happen in our view.
75
91
Looking back at the spike again:
@@ -1438,9 +1454,16 @@ $ *git diff --staged*
1438
1454
$ *git commit -m "Custom passwordless auth backend + custom user model"*
1439
1455
----
1440
1456
1441
-
1442
- image::images/21in03.png[]
1443
-
1457
+ [role="scratchpad"]
1458
+ *****
1459
+ * _[strikethrough line-through]#Token model with email + uid#_
1460
+ * _[strikethrough line-through]#_view to create token + send login email incl. url w/ token uid#_
1461
+ * _[strikethrough line-through]#Custom user model with USERNAME_FIELD=email#_
1462
+ * _[strikethrough line-through]#Authentication backend with authenticate() and get_user() functions#_
1463
+ * _[strikethrough line-through]#Register auth backend in settings.py#_
1464
+ * _[strikethrough line-through]#login view calls authenticate() and login() from django.contrib.auth#_
1465
+ * _logout view calls django.contrib.auth.logout_
1466
+ *****
1444
1467
1445
1468
1446
1469
=== Finishing Off Our FT, Testing Logout
@@ -1579,8 +1602,16 @@ WARNING: We're nowhere near a truly secure or acceptable login system here.
1579
1602
// authentication, we could mention that after logout, we can log in using any
1580
1603
// of the previous login magic links (there is no token invalidation)
1581
1604
1582
- image::images/21in04.png[]
1583
-
1605
+ [role="scratchpad"]
1606
+ *****
1607
+ * _[strikethrough line-through]#Token model with email + uid#_
1608
+ * _[strikethrough line-through]#_view to create token + send login email incl. url w/ token uid#_
1609
+ * _[strikethrough line-through]#Custom user model with USERNAME_FIELD=email#_
1610
+ * _[strikethrough line-through]#Authentication backend with authenticate() and get_user() functions#_
1611
+ * _[strikethrough line-through]#Register auth backend in settings.py#_
1612
+ * _[strikethrough line-through]#login view calls authenticate() and login() from django.contrib.auth#_
1613
+ * _[strikethrough line-through]#logout view calls django.contrib.auth.logout#_
1614
+ *****
1584
1615
1585
1616
In the next chapter, we'll start trying to put our login system to good use.
1586
1617
In the meantime, do a commit and enjoy this recap:
0 commit comments