auth-vir
Version:
Auth made easy and secure via JWT cookies, CSRF tokens, and password hashing helpers.
16 lines (15 loc) • 375 B
JavaScript
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() {
return randomString(256);
}