@aws-amplify/auth
Version:
Auth category of aws-amplify
17 lines (16 loc) • 618 B
TypeScript
/**
*
* @param length Desired length of the code verifier.
*
* **NOTE:** According to the [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636#section-4.1)
* A code verifier must be with a length >= 43 and <= 128.
*
* @returns An object that contains the generated `codeVerifier` and a method
* `toCodeChallenge` to generate the code challenge from the `codeVerifier`
* following the spec of [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636#section-4.2).
*/
export declare const generateCodeVerifier: (length: number) => {
value: string;
method: "S256";
toCodeChallenge(): string;
};