MCPcopy
hub / github.com/authts/oidc-client-ts / _init

Method _init

src/SessionMonitor.ts:32–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 }
31
32 protected async _init(): Promise<void> {
33 this._logger.create("_init");
34 const user = await this._userManager.getUser();
35 // doing this manually here since calling getUser
36 // doesn't trigger load event.
37 if (user) {
38 void this._start(user);
39 }
40 else if (this._userManager.settings.monitorAnonymousSession) {
41 const session = await this._userManager.querySessionStatus();
42 if (session) {
43 const tmpUser = {
44 session_state: session.session_state,
45 profile: session.sub ? {
46 sub: session.sub,
47 } : null,
48 };
49 void this._start(tmpUser);
50 }
51 }
52 }
53
54 protected _start = async (
55 user: User | {

Callers 1

constructorMethod · 0.95

Calls 3

getUserMethod · 0.80
querySessionStatusMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected