Revert all next-auth changes

This commit is contained in:
Jared Palmer 2023-06-21 14:19:13 -07:00
parent 6f51b01621
commit 8841f5570f
3 changed files with 18 additions and 11 deletions

15
auth.ts
View file

@ -1,25 +1,18 @@
import NextAuth, { type DefaultSession } from 'next-auth' import NextAuth from 'next-auth'
import GitHub from 'next-auth/providers/github' import GitHub from 'next-auth/providers/github'
declare module 'next-auth' {
interface Session {
user: {
/** The user's id. */
id: string
} & DefaultSession['user']
}
}
export const { export const {
handlers: { GET, POST }, handlers: { GET, POST },
auth, auth,
CSRF_experimental CSRF_experimental
// @ts-ignore
} = NextAuth({ } = NextAuth({
// @ts-ignore // @ts-ignore
providers: [GitHub], providers: [GitHub],
callbacks: { callbacks: {
// @ts-ignore
jwt: async ({ token, profile }) => { jwt: async ({ token, profile }) => {
if (profile) { if (profile?.id) {
token.id = profile.id token.id = profile.id
token.image = profile.picture token.image = profile.picture
} }

13
next-auth.d.ts vendored Normal file
View file

@ -0,0 +1,13 @@
import NextAuth, { DefaultSession } from 'next-auth'
declare module 'next-auth' {
/**
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
*/
interface Session {
user: {
/** The user's postal address. */
id: string
} & DefaultSession['user']
}
}

View file

@ -26,6 +26,7 @@
}, },
"include": [ "include": [
"next-env.d.ts", "next-env.d.ts",
"next-auth.d.ts",
"**/*.ts", "**/*.ts",
"**/*.tsx", "**/*.tsx",
".next/types/**/*.ts" ".next/types/**/*.ts"