getMeUser() — supabase Function Reference
Architecture documentation for the getMeUser() function in getMeUser.ts from the supabase codebase.
Entity Profile
Dependency Diagram
graph TD 3e2b9d89_c8b1_52a9_f252_f2fdede55e26["getMeUser()"] 220cf376_6913_f930_10cc_441b6ddcb173["getClientSideURL()"] 3e2b9d89_c8b1_52a9_f252_f2fdede55e26 -->|calls| 220cf376_6913_f930_10cc_441b6ddcb173 style 3e2b9d89_c8b1_52a9_f252_f2fdede55e26 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/cms/src/utilities/getMeUser.ts lines 7–43
export const getMeUser = async (args?: {
nullUserRedirect?: string
validUserRedirect?: string
}): Promise<{
token: string
user: User
}> => {
const { nullUserRedirect, validUserRedirect } = args || {}
const cookieStore = await cookies()
const token = cookieStore.get('payload-token')?.value
const meUserReq = await fetch(`${getClientSideURL()}/api/users/me`, {
headers: {
Authorization: `JWT ${token}`,
},
})
const {
user,
}: {
user: User
} = await meUserReq.json()
if (validUserRedirect && meUserReq.ok && user) {
redirect(validUserRedirect)
}
if (nullUserRedirect && (!meUserReq.ok || !user)) {
redirect(nullUserRedirect)
}
// Token will exist here because if it doesn't the user will be redirected
return {
token: token!,
user,
}
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does getMeUser() do?
getMeUser() is a function in the supabase codebase.
What does getMeUser() call?
getMeUser() calls 1 function(s): getClientSideURL.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free