fs / fs/python-base-graphql-api

Fix middleware

Đang mở
#17 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
0
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
api, authentication
Loại issue
Lỗi
Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
58/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.