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'
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
}