MCPcopy Index your code
hub / github.com/simstudioai/sim / createAnonymousSession

Function createAnonymousSession

apps/sim/lib/auth/anonymous.ts:86–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 * Creates an anonymous session for when auth is disabled.
85 */
86export function createAnonymousSession(): AnonymousSession {
87 const now = new Date()
88 return {
89 user: {
90 ...ANONYMOUS_USER,
91 createdAt: now,
92 updatedAt: now,
93 },
94 session: {
95 id: 'anonymous-session',
96 userId: ANONYMOUS_USER_ID,
97 expiresAt: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000), // 1 year
98 createdAt: now,
99 updatedAt: now,
100 token: 'anonymous-token',
101 ipAddress: null,
102 userAgent: null,
103 },
104 }
105}

Callers 2

getSessionImplFunction · 0.90
route.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected