Skip to main content

Module user

Module user 

Source

Structs§

Session
User

Functions§

accept_invite
Accept an invite - set password and clear invite token
authenticate
Authenticate a user and return them if successful
change_password
Change password
create
Create a new user (admin only)
create_session
Create a new session for a user
create_with_invite
Create a new user with an invite token (no password yet)
delete
Delete a user (admin only, cannot delete self)
delete_expired_sessions
Delete expired sessions (cleanup)
delete_session
Delete a session (logout)
ensure_default_admin
Create the default admin user if no users exist
find
Find user by ID
find_by_invite_token
Find user by invite token
generate_invite_token
Generate an invite token (12 bytes = 24 hex chars, short but secure)
get_user_from_session
Get user from session token
hash_password
Hash a password using Argon2
list_all
List all users (admin only)
verify_password
Verify a password against a hash