mirror of
https://github.com/penxio/penx.git
synced 2026-04-19 03:03:06 -04:00
24 lines
618 B
TypeScript
24 lines
618 B
TypeScript
import { User, UserRole } from '@prisma/client'
|
|
import NextAuth, { getServerSession, type NextAuthOptions } from 'next-auth'
|
|
import { authOptions } from './auth'
|
|
import { SubscriptionInSession } from './types'
|
|
|
|
export async function getSession() {
|
|
return getServerSession(authOptions) as Promise<{
|
|
// return getServerSession() as Promise<{
|
|
user: {
|
|
id: string
|
|
name: string
|
|
username: string
|
|
email: string
|
|
image: string
|
|
}
|
|
userId: string
|
|
address: string
|
|
chainId: string
|
|
ensName: string
|
|
role: UserRole
|
|
subscriptions: SubscriptionInSession[]
|
|
} | null>
|
|
}
|