()
| 59 | * @returns A random state for the OAuth 2.0 flow. |
| 60 | */ |
| 61 | export const generateOAuthState = () => { |
| 62 | // Generate a random state |
| 63 | const array = new Uint8Array(32); |
| 64 | crypto.getRandomValues(array); |
| 65 | return Array.from(array, (byte) => byte.toString(16).padStart(2, "0")).join( |
| 66 | "", |
| 67 | ); |
| 68 | }; |
| 69 | |
| 70 | /** |
| 71 | * Generates a human-readable error description from OAuth callback error parameters |
no outgoing calls
no test coverage detected