fix(auth): send password reset email when user has empty password #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We are introducing OpenID Connect integration soon in the back-end. When someone creates their account using OIDC, it leads to no password being added to the database. This needs to be handled – currently it is an empty string (non-null).
Making passwords optional in the Users table will allow us to keep that value null. If someone with a null password tries to login with a regular email+password combination, a reset password link is emailed to them. This also preempts any migration scenarios where accounts are migrated, but the password needs to be set up again.
Steps to implement for OIDC:
Create the migration to make password_hash nullableUpdate the User modelFix the relevant OIDC handlerspassword_hash
nullable, which make the code less strongly typed.password_hash
UNnullable, and ensure that if someone logs in and has an empty password, gets an email with a token to set the password.This means steps (1) and (2) and (4) are irrelevant. The focus is to send a specific password reset email for those who are trying to log in with an empty password, and do not have OIDC links.
fix(auth): make password optional for OIDC first accountsto fix(auth): send password reset email when user has empty password