|
|
|
@@ -10,6 +10,8 @@ declare module "next-auth" { |
|
|
|
refreshToken?: string; |
|
|
|
abilities: string[]; |
|
|
|
id?: string; |
|
|
|
/** JWT expiry (seconds since epoch); used to avoid redirecting to dashboard when token is expired */ |
|
|
|
exp?: number; |
|
|
|
} |
|
|
|
|
|
|
|
interface User { |
|
|
|
@@ -88,6 +90,7 @@ export const authOptions: AuthOptions = { |
|
|
|
session.accessToken = token.accessToken as string | null; |
|
|
|
session.refreshToken = token.refreshToken as string | undefined; |
|
|
|
session.abilities = token.abilities as string[]; |
|
|
|
session.exp = token.exp as number | undefined; |
|
|
|
|
|
|
|
// Also add abilities to session.user for easier client-side access |
|
|
|
if (session.user) { |
|
|
|
|