Skip to content

Commit

Permalink
Fix bug in passwordResetLink (#4965)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored Mar 3, 2021
1 parent 6853479 commit a00a382
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-stingrays-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/auth': major
---

Fixed a bug when using `passwordResetLink` with a `secretField` other than `'password'`. If you used a `secretField` other than `'password'` then the generated fields in your schema will change.
6 changes: 3 additions & 3 deletions packages-next/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ export function createAuth<GeneratedListTypes extends BaseGeneratedListTypes>({
} as const;

const additionalListFields = {
[`${secretField}ResetToken`]: password({ ...fieldConfig }),
[`${secretField}ResetIssuedAt`]: timestamp({ ...fieldConfig }),
[`${secretField}ResetRedeemedAt`]: timestamp({ ...fieldConfig }),
[`passwordResetToken`]: password({ ...fieldConfig }),
[`passwordResetIssuedAt`]: timestamp({ ...fieldConfig }),
[`passwordResetRedeemedAt`]: timestamp({ ...fieldConfig }),
[`magicAuthToken`]: password({ ...fieldConfig }),
[`magicAuthIssuedAt`]: timestamp({ ...fieldConfig }),
[`magicAuthRedeemedAt`]: timestamp({ ...fieldConfig }),
Expand Down

1 comment on commit a00a382

@vercel
Copy link

@vercel vercel bot commented on a00a382 Mar 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.