supertokens / supertokens/supertokens-python

Flask does not save user context across API lifecycle

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

Nobody has claimed this yet.

Dominant language
HTML
Stars
148
Forks
48
PR merge metrics
No merged PRs in 30d

Description

In the middleware implementation for flask, we use @app.before_request, @app.after_request and @app.errorhandler(SuperTokensError) to manage supertokens hooks for each API call. However, a fresh new context is created across these preventing users from accessing the same user context across their overrides.

Contributor guide

Open the contributing guide

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 with the Flask middleware implementation and trace the @app.before_request, @app.after_request, and @app.errorhandler(SuperTokensError) hooks across one API call. Confirm that the same user context remains available to user overrides throughout the lifecycle, including error handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.