You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm getting a type error when passing a custom Provider to the NextAuth method.
Error 1
When passing an id to the provider config, there's an error about Type 'string' is not assignable to type 'undefined'.
Error 2
However, if I don't set the id property, I get a different error about Object literal may only specify known properties, and 'protection' does not exist in type 'Provider<undefined, "oauth">'
Error 3
I'm also getting another type error if for domain if I set the Provider type using the template: const customProvider: Provider<'custom'> = {...}
Error: Property 'domain' is missing in type 'Provider<"custom", "oauth">' but required in type '{ domain: string; }'
Steps to reproduce
Steps to reproduce the behavior.
Include a link to public repository which can be used to reproduce the behaviour.
Expected behavior
If I set the id to be a string constant using the Provider<'custom'> type, I should be able to set the protection optional value (as per the docs)
Screenshots or error logs
If applicable add screenshots or error logs to help explain the problem.
Additional context
Add any other context about the problem here.
Feedback Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.
Found the documentation helpful
Found documentation but was incomplete
Could not find relevant documentation
Found the example project helpful
Did not find the example project helpful
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm getting a type error when passing a custom
Provider
to theNextAuth
method.Error 1
When passing an
id
to the provider config, there's an error aboutType 'string' is not assignable to type 'undefined'.
Error 2
However, if I don't set the
id
property, I get a different error aboutObject literal may only specify known properties, and 'protection' does not exist in type 'Provider<undefined, "oauth">'
Error 3
I'm also getting another type error if for
domain
if I set the Provider type using the template:const customProvider: Provider<'custom'> = {...}
Error:
Property 'domain' is missing in type 'Provider<"custom", "oauth">' but required in type '{ domain: string; }'
Steps to reproduce
Steps to reproduce the behavior.
Include a link to public repository which can be used to reproduce the behaviour.
Expected behavior
If I set the
id
to be a string constant using theProvider<'custom'>
type, I should be able to set theprotection
optional value (as per the docs)Screenshots or error logs
If applicable add screenshots or error logs to help explain the problem.
Additional context
Add any other context about the problem here.
Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.
The text was updated successfully, but these errors were encountered: