mirror of
https://github.com/ershisan99/www.git
synced 2025-12-18 05:19:23 +00:00
add role to session obj
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
|||||||
users,
|
users,
|
||||||
verificationTokens,
|
verificationTokens,
|
||||||
} from '@/server/db/schema'
|
} from '@/server/db/schema'
|
||||||
|
type UserRole = 'user' | 'admin'
|
||||||
/**
|
/**
|
||||||
* Module augmentation for `next-auth` types. Allows us to add custom properties to the `session`
|
* Module augmentation for `next-auth` types. Allows us to add custom properties to the `session`
|
||||||
* object and keep type safety.
|
* object and keep type safety.
|
||||||
@@ -22,7 +22,7 @@ declare module 'next-auth' {
|
|||||||
id: string
|
id: string
|
||||||
discord_id: string
|
discord_id: string
|
||||||
// ...other properties
|
// ...other properties
|
||||||
// role: UserRole;
|
role: UserRole
|
||||||
} & DefaultSession['user']
|
} & DefaultSession['user']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user