namespace
CSRF
namespace CSRF
Generate and verify CSRF tokens
- @param secret
The secret to use for the token. If not provided, Bun generates a random default secret in memory and uses it.
@param optionsThe options for the token.
@returnsThe generated token.
- @param token
The token to verify.
@param optionsThe options for the token.
@returnsTrue if the token is valid, false otherwise.