> For the complete documentation index, see [llms.txt](https://gift.icbest.ca/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gift.icbest.ca/giftmanager-docs/pages-and-functions/login.md).

# Login

**Logic**:

* Retrieve the username and password from the template.
* Hash the password using `Argon2id` with the module argon2 on default parameters
* Compare the hashed password and username (NOT case-sensitive) against entries in `users.json`.
* Set the session cookie upon successful authentication.

**Frontend**:

* The `login.html` template show a banner with the instruction to contact an already registered family member if no account. Will show errors messages if <mark style="color:red;">User does not exist</mark> or <mark style="color:red;">Wrong password</mark>.
