(response: SignoutResponse, state: State)
| 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"); |
no test coverage detected