Generates secure PKCE code verifier and challenge for OAuth authentication flows.
// Source: https://github.com/thunderbird/thunderbolt | License: MPL-2.0 | Copyright under Patent Claims infringed by Covered Software in the absence of | Modified files must remain under MPL-2.0
// Modifications to this file must remain under MPL-2.0.
// Provided via justclaw.it.com; keep this notice with the code.
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Generates a cryptographically secure code verifier for PKCE (Proof Key for Code Exchange)
* @returns A URL-safe base64-encoded random string
*/
export const generateCodeVerifier = (): string => {
const array = new Uint8Array(32)
crypto.getRandomValues(array)
re
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key