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

Method signoutCallback

src/UserManager.ts:432–451  ·  view source on GitHub ↗

* Process any response (callback) from the end session endpoint, by dispatching the request_type * and executing one of the following functions: * - UserManager.signoutRedirectCallback * - UserManager.signoutPopupCallback * - {@link UserManager.signoutSilentCallba

(url = window.location.href, keepOpen = false)

Source from the content-addressed store, hash-verified

430 * @throws `Error` If request_type is unknown or signout cannot be processed.
431 */
432 public async signoutCallback(url = window.location.href, keepOpen = false): Promise<SignoutResponse | undefined> {
433 const { state } = await this._client.readSignoutResponseState(url);
434 if (!state) {
435 return undefined;
436 }
437
438 switch (state.request_type) {
439 case "so:r":
440 return await this.signoutRedirectCallback(url);
441 case "so:p":
442 await this.signoutPopupCallback(url, keepOpen);
443 break;
444 case "so:s":
445 await this.signoutSilentCallback(url);
446 break;
447 default:
448 throw new Error("invalid request_type in state");
449 }
450 return undefined;
451 }
452
453 /**
454 * Query OP for user's current signin status.

Callers 3

endSignoutMainWindowFunction · 0.80

Calls 4

signoutPopupCallbackMethod · 0.95
signoutSilentCallbackMethod · 0.95

Tested by

no test coverage detected