Skip to content

Authentication backend.#63

Draft
Pdzly wants to merge 4 commits intomasterfrom
feature/auth-backend
Draft

Authentication backend.#63
Pdzly wants to merge 4 commits intomasterfrom
feature/auth-backend

Conversation

@Pdzly
Copy link
Copy Markdown
Collaborator

@Pdzly Pdzly commented Apr 4, 2026

No description provided.

Pdzly added 4 commits March 21, 2026 20:56
…ssword reset

Implement full auth system including user registration, login with
Argon2id password hashing, JWT access/refresh tokens, email verification
flow, password reset flow, and per-endpoint rate limiting for auth routes.
…differentiated paste rate limits

- Invalidate old reset tokens in forgot_password (was select-only, no-op)
- Invalidate old verification tokens in resend_verification_email
- Fix TokenExpiredError to use actual token type instead of hardcoded "access token"
- Narrow get_optional_current_user exception catch to auth-specific errors
- Fix stale get_exempt_key reference in paste routes via module-level access
- Add max_length=512 to LoginRequest fields to prevent Argon2 DoS
- Broaden _verify_password to catch InvalidHashError and HashingError
- Deduplicate password validation logic into shared function
- Add differentiated rate limits: authenticated users get 20/min vs 4/min anonymous
  for paste creation, using slowapi key-based limit resolution
Add user_id FK to pastes table so authenticated users' pastes are
associated with their account. Adds GET /pastes/me endpoint to
retrieve a user's own pastes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant