diff --git a/Pipfile b/Pipfile index 7dcb084a0b..dcc0bd670e 100644 --- a/Pipfile +++ b/Pipfile @@ -6,6 +6,9 @@ verify_ssl = true [packages] boto3 = "*" celery = "*" +channels = "*" +channels-redis = "*" +dacite = "*" defusedxml = "*" django = "*" django-cors-middleware = "*" @@ -17,19 +20,21 @@ django-otp = "*" django-prometheus = "*" django-recaptcha = "*" django-redis = "*" -djangorestframework = "*" django-storages = "*" +djangorestframework = "*" djangorestframework-guardian = "*" +docker = "*" drf_yasg2 = "*" facebook-sdk = "*" +geoip2 = "*" +gunicorn = "*" +kubernetes = "*" ldap3 = "*" lxml = "*" packaging = "*" psycopg2-binary = "*" pycryptodome = "*" pyjwkest = "*" -uvicorn = {extras = ["standard"],version = "*"} -gunicorn = "*" pyyaml = "*" qrcode = "*" requests-oauthlib = "*" @@ -38,14 +43,9 @@ service_identity = "*" structlog = "*" swagger-spec-validator = "*" urllib3 = {extras = ["secure"],version = "*"} -dacite = "*" -channels = "*" -channels-redis = "*" -kubernetes = "*" -docker = "*" -xmlsec = "*" -geoip2 = "*" +uvicorn = {extras = ["standard"],version = "*"} webauthn = "*" +xmlsec = "*" [requires] python_version = "3.9" diff --git a/authentik/root/settings.py b/authentik/root/settings.py index 6bcaeb1596..ebb503edb4 100644 --- a/authentik/root/settings.py +++ b/authentik/root/settings.py @@ -470,8 +470,6 @@ for _app in INSTALLED_APPS: pass if DEBUG: - INSTALLED_APPS.append("debug_toolbar") - MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware") CELERY_TASK_ALWAYS_EAGER = True INSTALLED_APPS.append("authentik.core.apps.AuthentikCoreConfig") diff --git a/authentik/root/urls.py b/authentik/root/urls.py index f920680c0c..5b9d77ddbf 100644 --- a/authentik/root/urls.py +++ b/authentik/root/urls.py @@ -63,13 +63,9 @@ urlpatterns += [ ] if settings.DEBUG: - import debug_toolbar urlpatterns = ( - [ - path("-/debug/", include(debug_toolbar.urls)), - ] - + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + urlpatterns ) diff --git a/web/src/elements/stages/authenticator_static/AuthenticatorStaticStage.ts b/web/src/elements/stages/authenticator_static/AuthenticatorStaticStage.ts index c03890cb64..a91298ca3e 100644 --- a/web/src/elements/stages/authenticator_static/AuthenticatorStaticStage.ts +++ b/web/src/elements/stages/authenticator_static/AuthenticatorStaticStage.ts @@ -3,6 +3,7 @@ import { css, CSSResult, customElement, html, property, TemplateResult } from "l import { WithUserInfoChallenge } from "../../../api/Flows"; import { COMMON_STYLES } from "../../../common/styles"; import { BaseStage } from "../base"; +import "../form"; export interface AuthenticatorStaticChallenge extends WithUserInfoChallenge { codes: number[]; diff --git a/web/src/elements/stages/authenticator_totp/AuthenticatorTOTPStage.ts b/web/src/elements/stages/authenticator_totp/AuthenticatorTOTPStage.ts index 22c92af8fc..3544e5fbd6 100644 --- a/web/src/elements/stages/authenticator_totp/AuthenticatorTOTPStage.ts +++ b/web/src/elements/stages/authenticator_totp/AuthenticatorTOTPStage.ts @@ -4,6 +4,7 @@ import { WithUserInfoChallenge } from "../../../api/Flows"; import { COMMON_STYLES } from "../../../common/styles"; import { BaseStage } from "../base"; import "webcomponent-qr-code"; +import "../form"; export interface AuthenticatorTOTPChallenge extends WithUserInfoChallenge { config_url: string; diff --git a/web/src/elements/stages/form.ts b/web/src/elements/stages/form.ts new file mode 100644 index 0000000000..e696edbf15 --- /dev/null +++ b/web/src/elements/stages/form.ts @@ -0,0 +1,35 @@ +import { customElement, LitElement, CSSResult, property } from "lit-element"; +import { TemplateResult, html } from "lit-html"; +import { Error } from "../../api/Flows"; +import { COMMON_STYLES } from "../../common/styles"; + +@customElement("ak-form-element") +export class FormElement extends LitElement { + + static get styles(): CSSResult[] { + return COMMON_STYLES; + } + + @property() + label?: string; + + @property({ type: Boolean }) + required = false; + + @property({ attribute: false }) + errors?: Error[]; + + render(): TemplateResult { + return html`
${error.string}
`; + })} +${error.string}
`; - })} -