generate random state parameter in oauth state machine
This commit is contained in:
parent
1c8bf36ea2
commit
4ef85f744c
1 changed files with 2 additions and 2 deletions
|
|
@ -117,8 +117,8 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
|
||||||
const array = new Uint8Array(32);
|
const array = new Uint8Array(32);
|
||||||
crypto.getRandomValues(array);
|
crypto.getRandomValues(array);
|
||||||
const state = Array.from(array, (byte) =>
|
const state = Array.from(array, (byte) =>
|
||||||
byte.toString(16).padStart(2, '0'),
|
byte.toString(16).padStart(2, "0"),
|
||||||
).join('');
|
).join("");
|
||||||
|
|
||||||
const { authorizationUrl, codeVerifier } = await startAuthorization(
|
const { authorizationUrl, codeVerifier } = await startAuthorization(
|
||||||
context.serverUrl,
|
context.serverUrl,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue