chore: upgrade next-auth
This commit is contained in:
parent
ffab8267a4
commit
a905555da4
5 changed files with 42 additions and 192 deletions
18
auth.ts
18
auth.ts
|
|
@ -1,18 +1,28 @@
|
|||
import NextAuth 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 id. */
|
||||
id: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const {
|
||||
handlers: { GET, POST },
|
||||
auth,
|
||||
CSRF_experimental
|
||||
// @ts-ignore
|
||||
} = NextAuth({
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
providers: [GitHub],
|
||||
callbacks: {
|
||||
// @ts-ignore
|
||||
jwt: async ({ token, profile }) => {
|
||||
if (profile?.id) {
|
||||
if (profile) {
|
||||
token.id = profile.id
|
||||
token.image = profile.picture
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue