Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii committed Apr 11, 2024
1 parent 07417b4 commit 5b58d4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions web/api/v1/auth_app/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class LoginService:

def __init__(self, request):
self.request = request
self.rest_settings: dict = settings.REST_AUTH
self.settings: dict = settings.REST_AUTH

def _authenticate(self, **kwargs: str):
return authenticate(self.request, **kwargs)
Expand Down Expand Up @@ -152,20 +152,20 @@ def __set_jwt_cookie(self, response, key: str, token_value: str, token_expiratio
key=key,
value=token_value,
expires=token_expiration,
secure=self.rest_settings['JWT_AUTH_SECURE'],
httponly=self.rest_settings['JWT_AUTH_HTTPONLY'],
samesite=self.rest_settings['JWT_AUTH_SAMESITE'],
domain=self.rest_settings['JWT_COOKIE_DOMAIN'],
secure=self.settings['JWT_AUTH_SECURE'],
httponly=self.settings['JWT_AUTH_HTTPONLY'],
samesite=self.settings['JWT_AUTH_SAMESITE'],
domain=self.settings['JWT_COOKIE_DOMAIN'],
)

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)
self.__set_jwt_cookie(response, self.settings['JWT_AUTH_COOKIE'], access_token, access_token_expiration)

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
response, self.settings['JWT_AUTH_REFRESH_COOKIE'], refresh_token, refresh_token_expiration
)


Expand Down
2 changes: 1 addition & 1 deletion web/user_profile/templates/user_profile/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="row">
<div class="col-sm-3"><!--left col-->
{% include 'user_profile/include/block_avatar.html' %}
</hr><br>
<hr><br>
{% include 'user_profile/include/block_followers.html' %}
{% include 'user_profile/include/block_website.html' %}
{% include 'user_profile/include/block_activity.html' %}
Expand Down

0 comments on commit 5b58d4d

Please sign in to comment.