Introduction
We have so far made efforts to register a user and save such user's data in our application. We then send a verification em...
For further actions, you may consider blocking this person and/or reporting abuse
Hi there, @sirneij ! Great series, one of the best actually I saw for a long time... so huuge thanks for sharing!
I bet someone could already point that in other ways, but I can't see anything here, so let me gentle share my experience after reading this publication and repo code:
src/routes/users/login.rsit seems like pub visibility modifier is misplaced: I assume it should be atlogin_user(), notget_user_who_is_active()so we can use it forsrc/routes/users/mod.rsfor example;login.rs, compiler is not happy about match oftokio::task::spawn_blocking():Once again — thank you for such an effort 💯
Hi @khannz I am really humbled that you found my article useful.
To the reviews, the source code actually has some updated code, a bit different than the one in this article: github.com/Sirneij/rust-auth/blob/...
You can check it out.
Thank you once again.
Hi John,
I'm trying to follow along as well and get stuck on the same login block:
cannot return value referencing local data
loggedin_user.passwordreturns a value referencing data owned by the current function
login.rs(18, 59):
loggedin_user.passwordis borrowed herecannot return value referencing local data
userreturns a value referencing data owned by the current function
The move for the loggedin_user to the blocking thread prevents us from returning the result of the password hash. I looked at the updated code and it looks to be the same. What am I missing?
Thanks for the help.
Jay.
Nevermind,
For those stuck, Mario's post below was the solution, you have to update the password hashing function to not take ownership of the password during the check, see branch:
branch origin/confirm-login-session-logout
Thanks again for a great series.
you are right @khannz! this series are pretty awesome,
I'm following the tutorial series right now and only fail here,
in this part of login and logout.....
I bring the files from repository branch origin/confirm-login-session-logout and keep going
congratulations for your awesome work @sirneij
Thank you @koakh