onecrayon / onecrayon/api.ashes.live

Global logout logic

Open
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Python
Stars
13
Forks
7
Avg merge
7h 39m
Merged PRs (30d)
1

Description

We need to expire all of a user's tokens when they change or reset their password:

  • Add a nullable tokens_invalid_before DateTime column to the User model
  • Create migration (then verify the behavior in editor, and strip out auto-generated comments):
    $ make shell-db
    root@hash:/code# alembic revision --autogenerate -m "Short description here"
    
  • Add logic to the token verification logic to check if the user has a tokens_invalid_before timestamp set, and if so ensure that the token's "issued at" timestamp is after that point (otherwise reject the token)
  • Update the code logic for password resets and changing passwords to invalidate tokens issued prior to the time the new password is set
  • Add tests to bring coverage to 100% for the new code

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the User model, token verification logic, and password reset and password-change handlers. Use make shell-db, then inspect the Alembic autogeneration and migration output. Done means tokens issued before either password operation are rejected, newer tokens continue to work, and tests provide 100% coverage for the new logic.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication, backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.