next-auth aws callback error
Unanswered
Sloth bear posted this in #help-forum
Sloth bearOP
Hello guysI hope you're all doing well. I'm encountering a perplexing issue with authentication in my Next.js 13.5 application, and I'm hoping someone here might be able to assist me.
In my application, I've set up authentication using a custom provider to authenticate users via the database. Additionally, I've integrated third-party providers like Google and Facebook, as well as a custom crypto wallet provider called Thirdweb. Strangely, the custom provider and Thirdweb are functioning perfectly, but Google and Facebook are not. When I deploy the application to Amplify, I receive the following error message: 2023-10-15T12:57:54.464-06:00
{
name: 'OAuthCallbackError',
code: undefined,
providerId: 'google',
message: 'state missing from the response'
}
This error specifically points to an issue related to the 'state' parameter in the OAuth response. It's noteworthy that all providers work flawlessly locally, but the problem arises once the application is deployed to Amplify.
the snippet of my authOptions.ts file where I configure the authentication are in the images:
In my application, I've set up authentication using a custom provider to authenticate users via the database. Additionally, I've integrated third-party providers like Google and Facebook, as well as a custom crypto wallet provider called Thirdweb. Strangely, the custom provider and Thirdweb are functioning perfectly, but Google and Facebook are not. When I deploy the application to Amplify, I receive the following error message: 2023-10-15T12:57:54.464-06:00
{
name: 'OAuthCallbackError',
code: undefined,
providerId: 'google',
message: 'state missing from the response'
}
This error specifically points to an issue related to the 'state' parameter in the OAuth response. It's noteworthy that all providers work flawlessly locally, but the problem arises once the application is deployed to Amplify.
the snippet of my authOptions.ts file where I configure the authentication are in the images: