* feat(web): improve session retrieval performance Switch to using `getServerSession` which avoids a HTTP round trip to retrieve session details. Additionally, migrate deprecated `app/lib/auth` calls to to `@calcom/lib` package. * fix: update failing test and lint * Consolidates auth code in features * Update yarn.lock * Update packages/trpc/server/createContext.ts * Oopsie --------- Co-authored-by: zomars <zomars@me.com>
11 lines
409 B
TypeScript
11 lines
409 B
TypeScript
import type { Session } from "next-auth";
|
|
import type { GetSessionParams } from "next-auth/react";
|
|
import { getSession as getSessionInner } from "next-auth/react";
|
|
|
|
export async function getSession(options: GetSessionParams): Promise<Session | null> {
|
|
const session = await getSessionInner(options);
|
|
|
|
// that these are equal are ensured in `[...nextauth]`'s callback
|
|
return session as Session | null;
|
|
}
|