auth-vir
Version:
Auth made easy and secure via JWT cookies, CSRF tokens, and password hashing helpers.
18 lines (15 loc) • 383 B
text/typescript
import {randomString} from '@augment-vir/common';
/**
* Name of the header attached to responses that stores the CSRF token value.
*
* @category Internal
*/
export const csrfTokenHeaderName = 'csrf-token';
/**
* Generates a random, cryptographically secure CSRF token.
*
* @category Internal
*/
export function generateCsrfToken(): string {
return randomString(256);
}