Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Update useAuth.ts #637

Closed
wants to merge 3 commits into from
Closed

Fix: Update useAuth.ts #637

wants to merge 3 commits into from

Conversation

dennismwas
Copy link

@dennismwas dennismwas commented Jan 13, 2024

This pull request fixes an issue with the sign in options when calling the Sign in Method, the primaryOptions when set to 'credentials' the sigin payload results in the string being split to single characters.
Thiis fix adresses that issue.

Example showcase

  const res = await signIn('credentials', {
        email: '[email protected]',
        password: 'qwerty'
      });

image

@dennismwas dennismwas changed the title Update useAuth.ts Fix: Update useAuth.ts Jan 13, 2024
@zoey-kaiser
Copy link
Member

Hi @dennismwas 👋

Thank you for taking the time to look into this! However, I don't believe this is an issue with the code. The local and refresh providers do not take a first parameter, as you describe above.

signIn({
	email: '[email protected]',
	password: 'qwerty'
})

The credentials parameters refers to the object you are supposed to pass, not a string. The second object are the further options you would like to pass. Therefore if you were to "unspread" the first one and then passed a credentials object, these would not be passed to the fetch request correctly, therefore requiring developers to always pass a string first, which we would not even read here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants