feat: add isNewUser arg on the signIn callback#8478
feat: add isNewUser arg on the signIn callback#8478kahveciderin wants to merge 12 commits intonextauthjs:mainfrom
isNewUser arg on the signIn callback#8478Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
|
@kahveciderin is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
|
As far as I understand, the "Credentials" provider is intended to support use cases where one has an existing system one needs to authenticate users against, so a user cannot be a new user when using the Credentials provider, thus I've now added |
…o reduce code duplication between callbackHandler and checkIfUserIsNew
|
I have exported the "input validation" lines to an external helper function, because the same thing with the |
|
I think I forgot to stage my last changes, will be pushing them now. |
|
This PR should now be ready to merge, would be happy to get some reviews. |
| } | ||
|
|
||
| try { | ||
| const isNewUser = await checkIfUserIsNew({ |
There was a problem hiding this comment.
This could be stored as let isNewUser = true on line 81 and set to false on line 89, couldn't it?
fa96b45 to
65aa467
Compare
isNewUser arg on the signIn callback
|
What's going on with this? Will it be merged? |
|
Please merge this work |
|
push |
|
merge when |
|
Another bump here! Thanks |
|
It looks like this issue did not receive any activity for 60 days. It will be closed in 7 days if no further activity occurs. If you think your issue is still relevant, commenting will keep it open. Thanks! |
|
To keep things tidy, we are closing this issue for now. If you think your issue is still relevant, leave a comment and we might reopen it. Thanks! |
This PR implements the isNewUser field on the signIn callback, to allow for the rejection of a potential sign up.
☕️ Reasoning
Sometimes we might want to reject the signIn event if the user doesn't already have an account.
🧢 Checklist
🎫 Affected issues
Fixes #8272