Skip to main content

Module user

Module user 

Source
Expand description

User queries. Validates email format on create + on lookup (inputs are normalised to trimmed-lowercase before the DB sees them).

Functions§

count
create
Create a new user with an argon2-hashed password. Email is normalised (trimmed + lowercased) so Alice@Example.com and alice@example.com can’t register separately.
find_by_email
find_by_id
set_active
set_password
Replace a user’s password hash and invalidate every live session for that user in the same transaction.