fs / fs/python-base-graphql-api
Fix middleware
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
In server\core\auth\jwt\middleware.py must be removed the following condition with access_token
From:
```python
def resolve(self, next, root, info, **kwargs): # noqa: WPS125
"""Middleware resolver."""
context = info.context
access_token = utils.get_access_token_by_request(context)
if access_token:
context.user = SimpleLazyObject(lambda: get_user(context))
context.refresh_token = SimpleLazyObject(lambda: get_refresh_token(context))
```
To:
```python
def resolve(self, next, root, info, **kwargs): # noqa: WPS125
"""Middleware resolver."""
context = info.context
context.user = SimpleLazyObject(lambda: get_user(context))
context.refresh_token = SimpleLazyObject(lambda: get_refresh_token(context))
```
Because context saves user and refresh_token statements in next requests.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Open server/core/auth/jwt/middleware.py and inspect the resolve method and its use of context, get_user, and get_refresh_token. Confirm the access-token condition is the source of the persistence issue, then verify that the middleware assigns the expected context values on subsequent requests.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- api, authentication
- Tipo di issue
- Bug
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 58/100