MCPcopy
hub / github.com/stephengpope/thepopebot / requireAuth

Function requireAuth

lib/code/actions.js:38–44  ·  view source on GitHub ↗

* Get the authenticated user or throw.

()

Source from the content-addressed store, hash-verified

36 * Get the authenticated user or throw.
37 */
38async function requireAuth() {
39 const session = await auth();
40 if (!session?.user?.id) {
41 throw new Error('Unauthorized');
42 }
43 return session.user;
44}
45
46/**
47 * Get all code workspaces for the authenticated user.

Callers 15

getChatsFunction · 0.90
getChatMessagesFunction · 0.90
createChatFunction · 0.90
deleteChatFunction · 0.90
renameChatFunction · 0.90
starChatFunction · 0.90
getInboxMessagesFunction · 0.90
getUnreadMessageCountFunction · 0.90
markMessageReadActionFunction · 0.90
markAllMessagesReadFunction · 0.90
generateChatTitleFunction · 0.90
getAppVersionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected