webdevcody / wdc-saas-starter-kit

https://wdcstarterkit.com/
MIT License
867 stars 221 forks source link

fix clash on conflict when re-sending a reset token #21

Closed jerebenitez closed 3 weeks ago

jerebenitez commented 1 month ago

Since the target for onConflictDoUpdate on createPasswordResetToken was set to resetToken.id instead of resetToken.userId, if I clicked twice on "Send Reset Email" it would throw an "Duplicate key value violates unique constraints" error instead of refreshing the token in the db.

webdevcody commented 3 weeks ago

thanks for the fix!