Skip to content

Password reset for user #77

Answered by lovasoa
MrTrebron asked this question in Q&A
Discussion options

You must be logged in to vote

Hello ! Usually password reset is implemented by sending an email with a secret URL containing a password reset token to the user. SQLPage itself cannot send emails. What you can do in SQLPage with standard SQL is generating a random password reset token, store it in the database, and use an external system to send the email.

INSERT INTO password_reset_tokens(token, username) VALUES (sqlpage.random_string(32), :username)

You can read: https://cheatsheetseries.owasp.org/cheatsheets/Forgot_Password_Cheat_Sheet.html

If you really are using a postgres database and you really need to, you can send an email directly from postgres using an extension such as pgMail.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MrTrebron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants