From 68eefd083ec651d44a147ef38f660163528537f9 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 16 Feb 2021 22:35:55 +0100 Subject: [PATCH] web: fix linting errors --- authentik/providers/saml/views/sso.py | 2 ++ web/src/elements/policies/BoundPoliciesList.ts | 2 +- web/src/elements/utils/LoadingState.ts | 1 - web/src/pages/applications/ApplicationViewPage.ts | 2 +- web/src/pages/providers/ProviderViewPage.ts | 3 ++- web/src/utils.ts | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/authentik/providers/saml/views/sso.py b/authentik/providers/saml/views/sso.py index 8c217d2af..7eea5d9ae 100644 --- a/authentik/providers/saml/views/sso.py +++ b/authentik/providers/saml/views/sso.py @@ -4,6 +4,7 @@ from typing import Optional from django.http import HttpRequest, HttpResponse from django.shortcuts import get_object_or_404 from django.utils.decorators import method_decorator +from django.views.decorators.clickjacking import xframe_options_sameorigin from django.views.decorators.csrf import csrf_exempt from structlog.stdlib import get_logger @@ -114,6 +115,7 @@ class SAMLSSOBindingRedirectView(SAMLSSOView): return None +@method_decorator(xframe_options_sameorigin, name="dispatch") @method_decorator(csrf_exempt, name="dispatch") class SAMLSSOBindingPOSTView(SAMLSSOView): """SAML Handler for SSO/POST bindings""" diff --git a/web/src/elements/policies/BoundPoliciesList.ts b/web/src/elements/policies/BoundPoliciesList.ts index 56f6d4cef..4b5798194 100644 --- a/web/src/elements/policies/BoundPoliciesList.ts +++ b/web/src/elements/policies/BoundPoliciesList.ts @@ -40,7 +40,7 @@ export class BoundPoliciesList extends Table { } else if (item.user) { return gettext(`User ${item.user.name}`); } else { - return gettext(``); + return gettext(""); } } diff --git a/web/src/elements/utils/LoadingState.ts b/web/src/elements/utils/LoadingState.ts index 0e59f8bdf..f6a51abd6 100644 --- a/web/src/elements/utils/LoadingState.ts +++ b/web/src/elements/utils/LoadingState.ts @@ -1,4 +1,3 @@ -import { commands } from "codemirror"; import { CSSResult, customElement, html, LitElement, TemplateResult } from "lit-element"; import { COMMON_STYLES } from "../../common/styles"; import { SpinnerSize } from "../Spinner"; diff --git a/web/src/pages/applications/ApplicationViewPage.ts b/web/src/pages/applications/ApplicationViewPage.ts index 7aa69605b..41065bc41 100644 --- a/web/src/pages/applications/ApplicationViewPage.ts +++ b/web/src/pages/applications/ApplicationViewPage.ts @@ -38,7 +38,7 @@ export class ApplicationViewPage extends LitElement { render(): TemplateResult { if (!this.application) { - return html``;; + return html``; } return html`
diff --git a/web/src/pages/providers/ProviderViewPage.ts b/web/src/pages/providers/ProviderViewPage.ts index c37a8234f..db7686820 100644 --- a/web/src/pages/providers/ProviderViewPage.ts +++ b/web/src/pages/providers/ProviderViewPage.ts @@ -4,6 +4,7 @@ import { COMMON_STYLES } from "../../common/styles"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; +import "./elements/utils/LoadingState"; import "./SAMLProviderViewPage"; import "./OAuth2ProviderViewPage"; @@ -26,7 +27,7 @@ export class ProviderViewPage extends LitElement { render(): TemplateResult { if (!this.provider) { - return html``;; + return html``; } switch (this.provider?.object_type) { case "saml": diff --git a/web/src/utils.ts b/web/src/utils.ts index bdb0544b9..f9bb7c865 100644 --- a/web/src/utils.ts +++ b/web/src/utils.ts @@ -1,5 +1,5 @@ import { html, TemplateResult } from "lit-html"; -import { SpinnerSize } from "./elements/Spinner"; +import "./elements/utils/LoadingState"; export function getCookie(name: string): string { let cookieValue = "";