MCPcopy
hub / github.com/nextauthjs/next-auth / getSession

Function getSession

src/react/index.tsx:124–135  ·  view source on GitHub ↗
(params?: GetSessionParams)

Source from the content-addressed store, hash-verified

122}
123
124export async function getSession(params?: GetSessionParams) {
125 const session = await fetchData<Session>(
126 "session",
127 __NEXTAUTH,
128 logger,
129 params
130 )
131 if (params?.broadcast ?? true) {
132 broadcast.post({ event: "session", data: { trigger: "getSession" } })
133 }
134 return session
135}
136
137/**
138 * Returns the current Cross Site Request Forgery Token (CSRF Token)

Callers 6

fetchUserSessionFunction · 0.90
PageFunction · 0.90
getServerSidePropsFunction · 0.90
protected.jsFile · 0.90
session.jsFile · 0.90
SessionProviderFunction · 0.85

Calls

no outgoing calls

Tested by 1

fetchUserSessionFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…