* Persist a one-time state token (and optional PKCE verifier) for the * duration of one OAuth round-trip.
(state: string, stored: IStoredState = {})
| 59 | * duration of one OAuth round-trip. |
| 60 | */ |
| 61 | async store(state: string, stored: IStoredState = {}): Promise<void> { |
| 62 | await this.getClient().setex( |
| 63 | `${OAUTH_STATE_PREFIX}${state}`, |
| 64 | OAUTH_STATE_TTL_SECONDS, |
| 65 | JSON.stringify(stored) |
| 66 | ); |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Read + delete the stored state. Returns `null` if absent (expired, |
no test coverage detected