authentik.stages.deny.stage

Deny stage logic

 1"""Deny stage logic"""
 2
 3from django.http import HttpRequest, HttpResponse
 4
 5from authentik.flows.stage import StageView
 6from authentik.stages.deny.models import DenyStage
 7
 8
 9class DenyStageView(StageView):
10    """Cancels the current flow"""
11
12    def dispatch(self, request: HttpRequest) -> HttpResponse:
13        """Cancels the current flow"""
14        stage: DenyStage = self.executor.current_stage
15        message = self.executor.plan.context.get("deny_message", stage.deny_message)
16        return self.executor.stage_invalid(message)
class DenyStageView(authentik.flows.stage.StageView):
10class DenyStageView(StageView):
11    """Cancels the current flow"""
12
13    def dispatch(self, request: HttpRequest) -> HttpResponse:
14        """Cancels the current flow"""
15        stage: DenyStage = self.executor.current_stage
16        message = self.executor.plan.context.get("deny_message", stage.deny_message)
17        return self.executor.stage_invalid(message)

Cancels the current flow

def dispatch( self, request: django.http.request.HttpRequest) -> django.http.response.HttpResponse:
13    def dispatch(self, request: HttpRequest) -> HttpResponse:
14        """Cancels the current flow"""
15        stage: DenyStage = self.executor.current_stage
16        message = self.executor.plan.context.get("deny_message", stage.deny_message)
17        return self.executor.stage_invalid(message)

Cancels the current flow