Untitled

 avatar
unknown
plain_text
2 months ago
603 B
8
Indexable
from django.http import HttpResponse
from authentication.api.token_service import TokenService
from authentication.api.cookie_service import CookieService
from authentication.models import Users


class JWTIssuerService:
    """
    Single point of JWT generation dan cookie injection.
    Dipanggil oleh SSO flow, Google flow, maupun Exhibition flow.
    """

    @staticmethod
    def issue(user: Users, response: HttpResponse) -> HttpResponse:
        tokens = TokenService.generate_tokens_for_user(user)
        CookieService.set_jwt_cookies(response, tokens)
        return response
Editor is loading...
Leave a Comment