Skip to content

Get Strava access_token #12415

Closed Answered by felixerdy
felixerdy asked this question in Help
Discussion options

You must be logged in to vote

After a night of sleep I got it running with the following auth.ts:

import NextAuth from "next-auth";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { JWT } from "next-auth/jwt";
import Strava from "next-auth/providers/strava";

declare module "next-auth" {
  interface Session {
    accessToken: string;
  }
  interface Account {
    access_token: string;
  }
}

declare module "next-auth/jwt" {
  interface JWT {
    accessToken: string;
  }
}

export const { handlers, signIn, signOut, auth } = NextAuth({
  providers: [
    Strava({
      authorization: {
        params: {
          scope: "activity:read_all",
        },
      },
    }),
  ],
  callbacks: {
    async jwt(

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by felixerdy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant