MCPcopy
hub / github.com/fccview/jotty / getCurrentUser

Function getCurrentUser

app/_server/actions/users/queries.ts:17–27  ·  view source on GitHub ↗
(
  username?: string
)

Source from the content-addressed store, hash-verified

15};
16
17export const getCurrentUser = async (
18 username?: string
19): Promise<User | null> => {
20 const sessionId = await getSessionId();
21 const sessions = await readSessions();
22 const currentUsername = sessions[sessionId || ""];
23
24 if (!currentUsername && !username) return null;
25
26 return (await getUserByUsername(currentUsername || username || "")) || null;
27};
28
29export const hasUsers = async (): Promise<boolean> => {
30 try {

Callers 15

i18n.tsFile · 0.90
generateMetadataFunction · 0.90
RootLayoutFunction · 0.90
PublicChecklistPageFunction · 0.90
PublicNotePageFunction · 0.90
HomePageFunction · 0.90
ChecklistPageFunction · 0.90
HowtoLayoutFunction · 0.90
NotesPageFunction · 0.90
NotesLayoutFunction · 0.90
SettingsLayoutFunction · 0.90
SessionsPageFunction · 0.90

Calls 3

getSessionIdFunction · 0.90
readSessionsFunction · 0.90
getUserByUsernameFunction · 0.85

Tested by

no test coverage detected