generate random state parameter in oauth state machine

This commit is contained in:
Konstantin Konstantinov 2025-07-13 08:44:57 +03:00
commit 4ef85f744c
No known key found for this signature in database

View file

@ -117,8 +117,8 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
const array = new Uint8Array(32);
crypto.getRandomValues(array);
const state = Array.from(array, (byte) =>
byte.toString(16).padStart(2, '0'),
).join('');
byte.toString(16).padStart(2, "0"),
).join("");
const { authorizationUrl, codeVerifier } = await startAuthorization(
context.serverUrl,