# Sign-Up and Sign-In Routes

A students table with a password_hash column and a UNIQUE email holds the accounts, a sign-up route hashes the password and answers 201 with the new student or 409 for a used email, a response model keeps the hash out of every answer, and sign-in answers a wrong email and a wrong password with the same 401.

![Cheat sheet: Sign-Up and Sign-In Routes](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/778111e603db4cd0a93674e517df8ec2.webp)

- Category: FastAPI
- Level: Journeyman
- Tags: 401 Unauthorized, 409 Conflict, Authentication, fastapi, rest-api, Unique Index
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/fastapi-auth-sign-up-and-sign-in-cheat-sheet
