Skip to content

Csanád's review of chapter 19 #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Conversation

Xronophobe
Copy link
Collaborator

I like the email-based authentication, even though I had mixed feelings about it initially (not in the book specifically, but about Magic Links in general).

In the "spike" part of the chapter we sometimes take bigger leaps without checking our work, which I found a bit difficult to keep up with at first. Although we can't always check our work step-by-step, and having to re-read a few paragraphs here and there is just how technical books work. Also, practicing to read and make sense of source code is how developers operate. So I would not necessarily change it, I'm just providing my impressions. More importantly, I found it extremely useful: showing the readers the thought process, the sources/docs used for discovering how we could make something (like this custom authentication) work.

A couple of further notes without checking whether later chapters address these:

  • not sure if we'll delete the tokens on /logout. I guess we certainly will, but I'm leaving a note regardless.
  • either way, I would still hash the token in the database, similar to how set_password() works in a password-based Django auth model. After all, a token alone grants full access to the user's account, so I would handle it the way I would handle a password.

@Xronophobe Xronophobe self-assigned this Dec 10, 2024
@Xronophobe Xronophobe force-pushed the csanad-review--chapter-19 branch from 4dc41cf to 3c10e6b Compare December 11, 2024 00:36
@Xronophobe Xronophobe requested a review from hjwp December 20, 2024 16:35
@hjwp
Copy link
Owner

hjwp commented Jan 29, 2025

thanks csanad! hash the tokens, yep, pretty obvious in retrospect. this is why you don't roll your own security folks! i might actually leave it as-is but call it out explicitly in a sidebar...

@hjwp hjwp merged commit 8e78160 into hjwp:main Jan 29, 2025
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants