MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / constructor

Method constructor

packages/cloud/src/WebAuthService.ts:101–127  ·  view source on GitHub ↗
(context: ExtensionContext, log?: (...args: unknown[]) => void)

Source from the content-addressed store, hash-verified

99 private isFirstRefreshAttempt: boolean = false
100
101 constructor(context: ExtensionContext, log?: (...args: unknown[]) => void) {
102 super()
103
104 this.context = context
105 this.log = log || console.log
106
107 this.log("[auth] Using WebAuthService")
108
109 // Calculate auth credentials key based on Clerk base URL.
110 const clerkBaseUrl = getClerkBaseUrl()
111
112 if (clerkBaseUrl !== PRODUCTION_CLERK_BASE_URL) {
113 this.authCredentialsKey = `clerk-auth-credentials-${clerkBaseUrl}`
114 } else {
115 this.authCredentialsKey = "clerk-auth-credentials"
116 }
117
118 this.timer = new RefreshTimer({
119 callback: async () => {
120 await this.refreshSession()
121 return true
122 },
123 successInterval: 50_000,
124 initialBackoffMs: 1_000,
125 maxBackoffMs: 300_000,
126 })
127 }
128
129 private changeState(newState: AuthState): void {
130 const previousState = this.state

Callers

nothing calls this directly

Calls 3

refreshSessionMethod · 0.95
getClerkBaseUrlFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected