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
The text was updated successfully, but these errors were encountered:
mackieq
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Dec 18, 2024
mackieq
changed the title
twitter callback api error
twitter callback error
Dec 18, 2024
mackieq
changed the title
twitter callback error
twitter oauth2.0 callback error
Dec 27, 2024
The original error this.getName is not a function has been resolved with the proper Twitter provider configuration.
Looking at the logs, I can confirm that the Twitter OAuth flow is working correctly and successfully fetching all user data. The logs show:
Successful OAuth initiation
Complete profile data retrieval
Proper token generation and management
Working OAuth callback
Here's, something: it's redirecting to sign-in page. The remaining issue is purely a redirect problem after successful authentication. The logs show:
GET /api/auth/callback/twitter?state=[state]&code=[code] 302 GET /login 200
This redirect loop occurs because the app is missing proper session handling. The repository appears to be missing some essential files for NextAuth to work correctly:
SessionProvider wrapper in the root layout
Proper session/authentication state handling in components
NextAuth type definitions
Would you mind confirming if these files are part of the main repo but not included in the next-auth-example repo? If not, they should be added to ensure the complete authentication flow works correctly.
I can submit a PR with these additions if you'd like.
Environment
Reproduction URL
https://github.com/mackieq/next-auth-example
Describe the issue
Twitter login:
after step 2, twitter redirect to http://localhost:3000/api/auth/callback/twitter?state=xxx&code=xxx
My nextjs console output error:
It seems like a certain field is missing or has an issue when fetching the user information.
How to reproduce
down load https://github.com/mackieq/next-auth-example, config twitter clientId and secret, then:
Expected behavior
login callback success
The text was updated successfully, but these errors were encountered: