File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change 1
- import type { DefaultSession } from 'next-auth'
1
+ import 'next-auth'
2
+ import { UserRoles } from './db/constants/users'
2
3
3
4
declare module 'next-auth' {
5
+ interface User {
6
+ role : UserRoles
7
+ }
4
8
interface Session {
5
- user : {
6
- id : string
7
- email : string
8
- image : Required < DefaultSession > [ 'user' ] [ 'image' ]
9
- name : Required < DefaultSession > [ 'user' ] [ 'name' ]
10
- }
9
+ user : User
11
10
}
12
11
}
13
12
Original file line number Diff line number Diff line change @@ -8,17 +8,10 @@ import GoogleProvider from 'next-auth/providers/google'
8
8
import { env } from '~/env.mjs'
9
9
import { loginSchema } from '~/schemas/auth'
10
10
import { updateSessionSchema } from '~/schemas/profile'
11
- import { UserRoles } from './db/constants/users'
12
11
import { db } from './db/db'
13
12
import { users } from './db/schema'
14
13
import { CustomAdapter } from './helpers/auth/custom-adapter'
15
14
16
- declare module 'next-auth' {
17
- interface User {
18
- role : UserRoles
19
- }
20
- }
21
-
22
15
export const authOptions : AuthOptions = {
23
16
adapter : CustomAdapter ,
24
17
providers : [
You can’t perform that action at this time.
0 commit comments