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

Method _buildUser

src/UserManager.ts:548–564  ·  view source on GitHub ↗
(signinResponse: SigninResponse, verifySub?: string)

Source from the content-addressed store, hash-verified

546 }
547
548 protected async _buildUser(signinResponse: SigninResponse, verifySub?: string) {
549 const logger = this._logger.create("_buildUser");
550 const user = new User(signinResponse);
551 if (verifySub) {
552 if (verifySub !== user.profile.sub) {
553 logger.debug("current user does not match user returned from signin. sub from signin:", user.profile.sub);
554 throw new ErrorResponse({ ...signinResponse, error: "login_required" });
555 }
556 logger.debug("current user matches user returned from signin");
557 }
558
559 await this.storeUser(user);
560 logger.debug("user stored");
561 await this._events.load(user);
562
563 return user;
564 }
565
566 /**
567 * Trigger a redirect of the current window to the end session endpoint.

Callers 2

_signinEndMethod · 0.95

Calls 4

storeUserMethod · 0.95
debugMethod · 0.65
createMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected