Get the latest tech news
Authentication with Axum
Consider this scenario: you’re building a website that has a classic navbar atthe top, this navbar has a button that reflects the user authentication s...
First thing you usually have to do is check if the user exists in your database, otherwise you’ll kindly 302 to a signup page where he/she has to register, returning a message to show in the login form sometimes works as well - whatever suits you. When you get your refresh token back you’re ready to move on and handle the last part of the process, which is generating the jwt and returning a valid response to the user that will set those cookies. Also, note that the responses I return in case of errors are not very exhaustive for most scenarios, I'm conciously leaving out the details because it's not the focus of this blog post.
Or read this on Hacker News