api/v1/handlers/authentication/logout.py
2024-01-15 13:32:24 +01:00

25 lines
653 B
Python

import sys
import os
current = os.path.dirname(os.path.realpath(__file__))
parent = os.path.dirname(current)
sys.path.append(parent)
from ioutils.protected import ProtectedHandler
from piracyshield_component.exception import ApplicationException
class AuthenticationLogoutHandler(ProtectedHandler):
"""
Removes the authentication refresh token.
The effective logout remains on the access token expiration time, this is why it should be set to a short time.
"""
def get(self):
if self.initialize_account() == False:
return
self.clear_cookie('refresh_token')
self.success(data = 'Goodbye!')