stages/authenticator_webuahtn: remove views
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
7a93b9e565
commit
36c34e05f8
|
@ -8,4 +8,3 @@ class AuthentikStageAuthenticatorWebAuthnConfig(AppConfig):
|
||||||
name = "authentik.stages.authenticator_webauthn"
|
name = "authentik.stages.authenticator_webauthn"
|
||||||
label = "authentik_stages_authenticator_webauthn"
|
label = "authentik_stages_authenticator_webauthn"
|
||||||
verbose_name = "authentik Stages.Authenticator.WebAuthn"
|
verbose_name = "authentik Stages.Authenticator.WebAuthn"
|
||||||
mountpoint = "-/user/authenticator/webauthn/"
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
"""WebAuthn urls"""
|
|
||||||
from django.urls import path
|
|
||||||
|
|
||||||
from authentik.stages.authenticator_webauthn.views import DeviceUpdateView
|
|
||||||
|
|
||||||
urlpatterns = [
|
|
||||||
path("devices/<int:pk>/update/", DeviceUpdateView.as_view(), name="device-update"),
|
|
||||||
]
|
|
|
@ -1,25 +0,0 @@
|
||||||
"""webauthn views"""
|
|
||||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
||||||
from django.contrib.messages.views import SuccessMessageMixin
|
|
||||||
from django.http.response import Http404
|
|
||||||
from django.utils.translation import gettext as _
|
|
||||||
from django.views.generic import UpdateView
|
|
||||||
|
|
||||||
from authentik.stages.authenticator_webauthn.forms import DeviceEditForm
|
|
||||||
from authentik.stages.authenticator_webauthn.models import WebAuthnDevice
|
|
||||||
|
|
||||||
|
|
||||||
class DeviceUpdateView(SuccessMessageMixin, LoginRequiredMixin, UpdateView):
|
|
||||||
"""Update device"""
|
|
||||||
|
|
||||||
model = WebAuthnDevice
|
|
||||||
form_class = DeviceEditForm
|
|
||||||
template_name = "generic/update.html"
|
|
||||||
success_url = "/"
|
|
||||||
success_message = _("Successfully updated Device")
|
|
||||||
|
|
||||||
def get_object(self) -> WebAuthnDevice:
|
|
||||||
device: WebAuthnDevice = super().get_object()
|
|
||||||
if device.user != self.request.user:
|
|
||||||
raise Http404
|
|
||||||
return device
|
|
Reference in New Issue