rails-authentication-from-scratch
rails-authentication-from-scratch copied to clipboard
A step-by-step guide on how to build your own authentication system in Rails from scratch.
Hi Steve, I'm confused about the check for `request.local?` in `store_location`. The reason I ask is that redirecting to the originally requested URL works in dev but not production on...
https://github.com/stevepolitodesign/rails-authentication-from-scratch/blob/9823b3a8682f0132004e0f9a77fb26b197e5be9a/test/test_helper.rb#L17 Hi. This line seems vague to me. Have you tried to type "elsif" or am I not understanding the purpose of this line? :)
## Before https://github.com/stevepolitodesign/rails-authentication-from-scratch/blob/b3e253fe2986d5672ba50f4ca23d4af038d5e8b1/app/controllers/concerns/authentication.rb#L37-L39 ## After ```ruby def remember(active_session) cookies.permanent.encrypted[:remember_token] = { value: active_session.remember_token, httponly: true } end ``` Issues ------- [set httponly cookie](https://github.com/stevepolitodesign/rails_mvp_authentication/issues/53#issuecomment-1051187056)
https://github.com/stevepolitodesign/rails-authentication-from-scratch/blob/b3e253fe2986d5672ba50f4ca23d4af038d5e8b1/app/models/user.rb#L57 Issues ------- https://github.com/stevepolitodesign/rails_mvp_authentication/issues/54
I should up the the intro to reference [the generator](https://github.com/stevepolitodesign/rails_mvp_authentication). - [ ] Update [blog post](https://stevepolito.design/blog/rails-authentication-from-scratch/) - [ ] Update [Dev.to post](https://dev.to/stevepolitodesign/rails-authentication-from-scratch-38m2)
Using Rails signed IDs is certainly an elegant way to go about account activations and password resets and 99.9% of the time I reckon they're fine in terms of security....
To stop from having multiple nested `if` statements.
Same as the previous one, just to avoid having multiple nested `if` statements for simplicity _(hopefully)_ !
First of all, thanks for this guide. It's been super interesting going through it I found the order of controller actions very strange because usually they go in pairs: -...
I thought the whole point of having this operator was to have the user memoized? With it removed yes the current user is cached into the db, but does that...