(url: string, removeState = false)
| 375 | } |
| 376 | |
| 377 | public async readSignoutResponseState(url: string, removeState = false): Promise<{ state: State | undefined; response: SignoutResponse }> { |
| 378 | const logger = this._logger.create("readSignoutResponseState"); |
| 379 | |
| 380 | const response = new SignoutResponse(UrlUtils.readParams(url, this.settings.response_mode)); |
| 381 | if (!response.state) { |
| 382 | logger.debug("No state in response"); |
| 383 | |
| 384 | if (response.error) { |
| 385 | logger.warn("Response was error:", response.error); |
| 386 | throw new ErrorResponse(response); |
| 387 | } |
| 388 | |
| 389 | return { state: undefined, response }; |
| 390 | } |
| 391 | |
| 392 | const storedStateString = await this.settings.stateStore[removeState ? "remove" : "get"](response.state); |
| 393 | if (!storedStateString) { |
| 394 | logger.throw(new Error("No matching state found in storage")); |
| 395 | // eslint-disable-next-line @typescript-eslint/only-throw-error |
| 396 | throw null; // https://github.com/microsoft/TypeScript/issues/46972 |
| 397 | } |
| 398 | |
| 399 | const state = await State.fromStorageString(storedStateString); |
| 400 | return { state, response }; |
| 401 | } |
| 402 | |
| 403 | public async processSignoutResponse(url: string): Promise<SignoutResponse> { |
| 404 | const logger = this._logger.create("processSignoutResponse"); |
no test coverage detected