Skip to content

Commit

Permalink
fix next-auth type error since it's been 2 weeks and next-auth still …
Browse files Browse the repository at this point in the history
…didn't fix itself

Signed-off-by: Vu Van Dung <[email protected]>
  • Loading branch information
joulev committed Feb 5, 2024
1 parent b14bdf5 commit bf5df87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/lib/auth/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ export const {
if (account) token.accessToken = account.access_token;
return token;
},
session: ({ session, token }) => {
if (typeof token.accessToken === "string") session.accessToken = token.accessToken;
return session;
session: props => {
if ("token" in props && typeof props.token.accessToken === "string")
props.session.accessToken = props.token.accessToken;
return props.session;
},
signIn: ({ profile }) => {
const JOULEV_USER_ID = "858763";
Expand Down
3 changes: 0 additions & 3 deletions src/types/fix/next-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ declare module "next-auth" {
interface Profile {
id: string;
}
interface User {
id: string;
}
}

0 comments on commit bf5df87

Please sign in to comment.