feat: ✨ Add collaboration
This commit is contained in:
10
apps/builder/services/api/utils.ts
Normal file
10
apps/builder/services/api/utils.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { User } from 'db'
|
||||
import { NextApiRequest } from 'next'
|
||||
import { getSession } from 'next-auth/react'
|
||||
|
||||
export const getAuthenticatedUser = async (
|
||||
req: NextApiRequest
|
||||
): Promise<User | undefined> => {
|
||||
const session = await getSession({ req })
|
||||
return session?.user as User | undefined
|
||||
}
|
Reference in New Issue
Block a user