(Some) users coming back from twitter have error=OAuthCreateAccount
Question 💬
We designed a login page with Twitter OAuth login and we're having an issue with a minority of users that come back to the redirect and the URL params have error=OAuthCreateAccount.
I haven't been able to find any information on what this mean by Googling - has anyone else come across this case?
How to reproduce ☕️
We haven't been able to reproduce the issue, other than log it with Sentry.
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
This seems to be relevant: https://github.com/nextauthjs/next-auth/blob/cbf9622e6fc18e6cb344e1b0fae3e8e39bcf5aee/docs/versioned_docs/version-v3/configuration/pages.md#sign-in-page
So it seems the user creation failed with an error?
Update: I added logger callbacks and captured errors - it looks like we're getting these four causes:
-
CLIENT_FETCH_ERROR with
"**non-serializable** (TypeError: Cannot read property 'constructor' of null)"- What is this? Using prisma adapter. -
Request token missing - what is this?
-
local storage cant be accessed - anything we can do?
-
Unique constraint failed while our only constraint in prisma is the one from the example:
@@unique([provider, providerAccountId])
{
clientVersion: 4.0.0,
code: P2002,
message: Unique constraint failed on the (not available),
meta: {
target: None
},
name: Error,
stack:
Error: Unique constraint failed on the (not available)
at RequestHandler.handleRequestError (/var/task/node_modules/@prisma/client/runtime/index.js:49670:13)
at RequestHandler.request (/var/task/node_modules/@prisma/client/runtime/index.js:49652:12)
at async PrismaClient._request (/var/task/node_modules/@prisma/client/runtime/index.js:50572:18)
}
Do you have browser information on these reports?
I think 1 and 3 are related. local storage cant be accessed sounds like either some old browser or something very strict is set on the browser, like this https://www.chromium.org/for-testers/bug-reporting-guidelines/uncaught-securityerror-failed-to-read-the-localstorage-property-from-window-access-is-denied-for-this-document/#:~:text=To%20find%20the%20setting%2C%20open,result%20in%20thrown%20SecurityError%20exceptions. :thinking:
For 2: https://stackoverflow.com/questions/55876669/twitter-oauth-access-token-error-request-token-missing
4 might be the result of the combination of the above. A user cannot be created or only created half (eg Account but not User or vice versa)
Either way, please attach a reproduction so we could verify, but at this point, it does not sound like we can do anything about this issue. You can see the Twitter login working fine here: https://next-auth-example.vercel.app/
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!