admin: add metrics and charts

This commit is contained in:
Jens Langhammer
2020-10-05 22:09:57 +02:00
parent ae125dd1f0
commit da9aaf69df
8 changed files with 258 additions and 86 deletions

View File

@ -10,6 +10,7 @@ from django.utils import timezone
from django.views import View
from structlog import get_logger
from passbook.audit.models import Event, EventAction
from passbook.core.models import Application
from passbook.flows.models import in_memory_stage
from passbook.flows.planner import (
@ -226,6 +227,11 @@ class OAuthFulfillmentStage(StageView):
"consent_required",
self.params.grant_type,
)
Event.new(
EventAction.AUTHORIZE_APPLICATION,
authorized_application=application,
flow=self.executor.plan.flow_pk,
).from_http(self.request)
return redirect(self.create_response_uri())
except (ClientIdError, RedirectUriError) as error:
self.executor.stage_invalid()