You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if it would be useful to return an {:error, reason} tuple or something to indicate that there was an error. Otherwise you need to wrap it try..catch block.
I ran into this issue because I was not hashing the password before inserting them in the DB, so when I tried to log in I got this error.
The text was updated successfully, but these errors were encountered:
Thanks for raising this issue. After some reflection, though, I've decided to leave this behavior as it is - I think it should raise an error in this situation. Sorry!
I don't really think you need to wrap the function in a try...catch block. Now that you realize that the password needs to be hashed, there's going to be no problem, and it's not going to be affected by any invalid user input because the developer is in control of the stored hash.
Currently if you try to use
checkpw/2
with a non-hashed password it fails with the following error:I'm wondering if it would be useful to return an
{:error, reason}
tuple or something to indicate that there was an error. Otherwise you need to wrap ittry..catch
block.I ran into this issue because I was not hashing the password before inserting them in the DB, so when I tried to log in I got this error.
The text was updated successfully, but these errors were encountered: