|
|
@@ -3,11 +3,12 @@ import CredentialsProvider from "next-auth/providers/credentials"; |
|
|
|
import { LOGIN_API_PATH } from "./api"; |
|
|
|
|
|
|
|
export interface SessionWithTokens extends Session { |
|
|
|
accessToken?: string; |
|
|
|
accessToken: string | null; |
|
|
|
refreshToken?: string; |
|
|
|
abilities: string[] |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const authOptions: AuthOptions = { |
|
|
|
debug: process.env.NODE_ENV === "development", |
|
|
|
providers: [ |
|
|
@@ -49,7 +50,7 @@ export const authOptions: AuthOptions = { |
|
|
|
const sessionWithToken: SessionWithTokens = { |
|
|
|
...session, |
|
|
|
// Add the data from the token to the session |
|
|
|
accessToken: token.accessToken as string | undefined, |
|
|
|
accessToken: token.accessToken as string | null, |
|
|
|
refreshToken: token.refreshToken as string | undefined, |
|
|
|
abilities: token.abilities as string[] |
|
|
|
}; |
|
|
|