Skip to content

Commit

Permalink
post create
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii committed Mar 21, 2024
1 parent 100be3f commit 0acbbe1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
6 changes: 4 additions & 2 deletions web/api/v1/auth_app/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
from main.decorators import except_shell

if TYPE_CHECKING:
from django.http import HttpResponse

from main.models import UserType

User: 'UserType' = get_user_model()
Expand Down Expand Up @@ -156,11 +158,11 @@ def __set_jwt_cookie(self, response, key: str, token_value: str, token_expiratio
domain=self.rest_settings['JWT_COOKIE_DOMAIN'],
)

def _set_jwt_access_cookie(self, response, access_token):
def _set_jwt_access_cookie(self, response: "HttpResponse", access_token: str):
access_token_expiration = timezone.now() + jwt_settings.ACCESS_TOKEN_LIFETIME
self.__set_jwt_cookie(response, self.rest_settings['JWT_AUTH_COOKIE'], access_token, access_token_expiration)

def _set_jwt_refresh_cookie(self, response, refresh_token):
def _set_jwt_refresh_cookie(self, response: "HttpResponse", refresh_token: str):
refresh_token_expiration = timezone.now() + jwt_settings.REFRESH_TOKEN_LIFETIME
self.__set_jwt_cookie(
response, self.rest_settings['JWT_AUTH_REFRESH_COOKIE'], refresh_token, refresh_token_expiration
Expand Down
18 changes: 0 additions & 18 deletions web/blog/templatetags/blog.py

This file was deleted.

1 change: 0 additions & 1 deletion web/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import NamedTuple

import pytest

from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.files.base import ContentFile
Expand Down

0 comments on commit 0acbbe1

Please sign in to comment.