summaryrefslogtreecommitdiff
path: root/service/pixelated/resources/logout_resource.py
blob: fe80316e4cb6f767af363890421140d7159d383e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from pixelated.resources import BaseResource
from twisted.web import util

from pixelated.resources.login_resource import LoginResource


class LogoutResource(BaseResource):
    BASE_URL = "logout"
    isLeaf = True

    def render_GET(self, request):
        session = self.get_session(request)
        self._services_factory.log_out_user(session.user_uuid)
        session.expire()

        return util.redirectTo("/%s" % LoginResource.BASE_URL, request)