Skip to main content

## Module store

Source
Expand description

Database access for profiles.

Everything here takes an explicit `user_id`. There is no ambient “current user” in this module — the caller has to say who it means, which is what stops a switch half-applying and writing one profile’s state under another’s id.

TRACES: UR-082, UR-083 | DR-267, DR-268

## Functions§

clear_pin
  Remove a profile’s PIN, making it a one-tap profile.
get_pin
  The stored PIN hash and attempt counters, or `None` when no PIN is set.
get_profile
  Fetch a single profile, or `None` if this device does not know it.
list_profiles
  List every profile known for a server, most recently used first.
remove_profile
  Forget a profile: its PIN, its per-user rows, and its `users` row.
save_pin_state
  Persist the counter state produced by `super::pin::evaluate`.
set_pin
  Store (or replace) a profile’s PIN, resetting its counters.