NextAuth Strava Provider - Unable to get accessToken back #10049
-
Hi folks 👋🏻 I've got a really basic NextJS app that leverages the Strava Provider. Which seems to work OK so far, but I'm not sure if I'm encountering a pebcac issue (most likely!) So I've got my [...nextauth]/route.ts setup as follows:
Then on my login page I have the following (trimmed for this post):
This all works great, and I get back a user correctly. But I'm also expecting an accessToken back to make subsequent requests out to the provider in question. Am I missing something? 🙏🏻 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Frustratingly found this out moments after posting this, but will share for visibility: I needed to add a callback to get this. Although this isnt explicit in the docs
|
Beta Was this translation helpful? Give feedback.
-
Hi james, I was trying to achieve a similar application to have some hands on practice with Authentication and API calls, I was wondering if I could ask you some questions, and maybe get some guidance on the whole process. Thank you for your time! |
Beta Was this translation helpful? Give feedback.
-
Anyone got this working for next-auth v5? The proposed solution does not work for me. |
Beta Was this translation helpful? Give feedback.
Frustratingly found this out moments after posting this, but will share for visibility:
I needed to add a callback to get this.
Although this isnt explicit in the docs