Revert all next-auth changes
This commit is contained in:
parent
6f51b01621
commit
8841f5570f
3 changed files with 18 additions and 11 deletions
15
auth.ts
15
auth.ts
|
|
@ -1,25 +1,18 @@
|
|||
import NextAuth, { type DefaultSession } from 'next-auth'
|
||||
import NextAuth from 'next-auth'
|
||||
import GitHub from 'next-auth/providers/github'
|
||||
|
||||
declare module 'next-auth' {
|
||||
interface Session {
|
||||
user: {
|
||||
/** The user's id. */
|
||||
id: string
|
||||
} & DefaultSession['user']
|
||||
}
|
||||
}
|
||||
|
||||
export const {
|
||||
handlers: { GET, POST },
|
||||
auth,
|
||||
CSRF_experimental
|
||||
// @ts-ignore
|
||||
} = NextAuth({
|
||||
// @ts-ignore
|
||||
providers: [GitHub],
|
||||
callbacks: {
|
||||
// @ts-ignore
|
||||
jwt: async ({ token, profile }) => {
|
||||
if (profile) {
|
||||
if (profile?.id) {
|
||||
token.id = profile.id
|
||||
token.image = profile.picture
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue