Skip to content

Commit

Permalink
Fix next-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpalmer committed Jun 21, 2023
1 parent 28f62d8 commit f2ae20d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 44 deletions.
16 changes: 13 additions & 3 deletions auth.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import NextAuth from 'next-auth'
import NextAuth, { type DefaultSession } from 'next-auth'
import GitHub from 'next-auth/providers/github'

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

export const {
handlers: { GET, POST },
auth,
CSRF_experimental
// @ts-ignore
} = NextAuth({
// @ts-ignore
providers: [GitHub],
callbacks: {
// @ts-ignore
jwt: async ({ token, profile }) => {
if (profile?.id) {
token.id = profile.id
Expand Down
13 changes: 0 additions & 13 deletions next-auth.d.ts

This file was deleted.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"focus-trap-react": "^10.1.1",
"nanoid": "^4.0.2",
"next": "13.4.7-canary.1",
"next-auth": "0.0.0-manual.4cd21ea5",
"next-auth": "0.0.0-manual.e65faa1c",
"next-themes": "^0.2.1",
"openai-edge": "^0.5.1",
"react": "^18.2.0",
Expand Down Expand Up @@ -67,10 +67,5 @@
"tailwindcss-animate": "^1.0.5",
"typescript": "^5.1.3"
},
"pnpm": {
"overrides": {
"@auth/nextjs": "0.0.0-manual.223c6467"
}
},
"packageManager": "[email protected]"
}
26 changes: 11 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
],
"strictNullChecks": true
},
"include": [
"next-env.d.ts",
"next-auth.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

0 comments on commit f2ae20d

Please sign in to comment.