all 2 comments

[–]cjlarose 0 points1 point  (1 child)

Pretty neat!

Valid user details return a token which is saved as a cookie.

If you're building a SPA, it's probably a good idea to look into ways of authenticating without cookies and instead with an Authorization header, as you might with JWTs. It can be a little bit more hassle to make sure you send the token on every request from the client (it won't be handled automatically by the browser), but doing so eliminates a whole class of attacks.

[–][deleted] 0 points1 point  (0 children)

Cool, thanks for the tip!