Multiple users with the same email. #5125
Unanswered
HuwPriceTP
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm currently working on a project where we're using Okta as the only auth provider for the project and DynamoDB.
Following the documentation we got it all working. However, one issue we found with our use case is that we could potentially have multiple users (usernames) with the same email. This is a customer requirement imposed on the project.
From reading the documentation, I understand that in this type of circumstance it's to be seen that a user has logged in with one provider and then tried another and their accounts are not linked. Resulting in an error of:
To confirm your identity, sign in with the same account you used originally.
Automatically going down the account linking route which is not what we're after.
To overcome this on the
signIn
callback in [...nextauth].ts we are mapping values to achieve the desired functionality of having multiple users unique users with the same email address being able to log in. For example, thesub
field from okta is being mapped toemail
since it's a unique identifier per user. But it does look strange in the DB that email isn't actually an email.I see from reviewing the DynamoDB adapter code that
user.email
is a fixed key and there's no way of changing this functionality currently (without using something like patch-package).Do you ever intend to support this use case of multiple users to one email? If not do you agree that mapping is the best approach or potentially have a better approach?
Beta Was this translation helpful? Give feedback.
All reactions