Module auth

Module auth 

Source
Expand description

Authentication: Argon2 password hashing and JWT tokens.

Structs§

AdminClaims
Claims payload stored inside admin JWT tokens.

Functions§

create_jwt
Create a signed JWT for the given username, valid for 24 hours.
hash_password
Hash a plaintext password using Argon2id with a random salt.
verify_jwt
Verify a JWT and return its claims.
verify_password
Verify a plaintext password against an Argon2id hash.