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

Method validateSignoutResponse

src/ResponseValidator.ts:95–111  ·  view source on GitHub ↗
(response: SignoutResponse, state: State)

Source from the content-addressed store, hash-verified

93 }
94
95 public validateSignoutResponse(response: SignoutResponse, state: State): void {
96 const logger = this._logger.create("validateSignoutResponse");
97 if (state.id !== response.state) {
98 logger.throw(new Error("State does not match"));
99 }
100
101 // now that we know the state matches, take the stored data
102 // and set it into the response so callers can get their state
103 // this is important for both success & error outcomes
104 logger.debug("state validated");
105 response.userState = state.data;
106
107 if (response.error) {
108 logger.warn("Response was error", response.error);
109 throw new ErrorResponse(response);
110 }
111 }
112
113 protected _processSigninState(response: SigninResponse, state: SigninState): void {
114 const logger = this._logger.create("_processSigninState");

Callers 2

Calls 4

throwMethod · 0.80
debugMethod · 0.65
warnMethod · 0.65
createMethod · 0.45

Tested by

no test coverage detected