|
|
@@ -1,5 +1,5 @@ |
|
|
|
import { SessionStaff, SessionWithTokens, authOptions } from "@/config/authConfig" |
|
|
|
import { getServerSession } from "next-auth" |
|
|
|
// import { SessionStaff, SessionWithTokens, authOptions } from "@/config/authConfig" |
|
|
|
// import { getServerSession } from "next-auth" |
|
|
|
export interface WildCard { |
|
|
|
[key: string]: any; |
|
|
|
} |
|
|
@@ -51,17 +51,17 @@ export function readIntFromString(input: string): [string, number | null] | stri |
|
|
|
return [stringPart, intPart]; |
|
|
|
} |
|
|
|
|
|
|
|
export const getUserSession = async () => { |
|
|
|
const session = await getServerSession(authOptions) as SessionWithTokens; |
|
|
|
return session |
|
|
|
} |
|
|
|
// export const getUserSession = async () => { |
|
|
|
// const session = await getServerSession(authOptions) as SessionWithTokens; |
|
|
|
// return session |
|
|
|
// } |
|
|
|
|
|
|
|
export const getUserAbilities = async () => { |
|
|
|
const session = await getServerSession(authOptions) as SessionWithTokens; |
|
|
|
return session?.abilities ?? [] as string[] |
|
|
|
} |
|
|
|
// export const fetchUserAbilities = async () => { |
|
|
|
// const session = await getServerSession(authOptions) as SessionWithTokens; |
|
|
|
// return session?.abilities ?? [] as string[] |
|
|
|
// } |
|
|
|
|
|
|
|
export const getUserStaff = async () => { |
|
|
|
const session = await getServerSession(authOptions) as SessionWithTokens; |
|
|
|
return session?.staff as SessionStaff |
|
|
|
} |
|
|
|
// export const fetchUserStaff = async () => { |
|
|
|
// const session = await getServerSession(authOptions) as SessionWithTokens; |
|
|
|
// return session?.staff as SessionStaff |
|
|
|
// } |