Fix next-auth
This commit is contained in:
parent
28f62d80cf
commit
f2ae20d26b
5 changed files with 26 additions and 44 deletions
16
auth.ts
16
auth.ts
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue