diff options
author | B. Stack <bgstack15@gmail.com> | 2023-06-17 12:47:09 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-06-24 08:22:59 -0400 |
commit | 4a9594a15670785751a6d82d99a408a27b6e8c2e (patch) | |
tree | 6f9c93aac012155dfb9b745026711adca489b239 /newspipe/web | |
parent | WIP: add db string user.external_auth (diff) | |
download | newspipe-4a9594a15670785751a6d82d99a408a27b6e8c2e.tar.gz newspipe-4a9594a15670785751a6d82d99a408a27b6e8c2e.tar.bz2 newspipe-4a9594a15670785751a6d82d99a408a27b6e8c2e.zip |
use attribute external_auth
Diffstat (limited to 'newspipe/web')
-rw-r--r-- | newspipe/web/forms.py | 3 | ||||
-rw-r--r-- | newspipe/web/views/views.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/newspipe/web/forms.py b/newspipe/web/forms.py index 4cd552e0..7a245b94 100644 --- a/newspipe/web/forms.py +++ b/newspipe/web/forms.py @@ -173,6 +173,7 @@ class SigninForm(RedirectForm): automatic_crawling=True, is_admin=False, is_active=True, + external_auth="ldap", ) if user: validated = True @@ -199,7 +200,7 @@ class SigninForm(RedirectForm): self.password.errors.append("Wrong password") validated = False else: - self.password.errors.append("External auth unavailable. Contact the admin.") + self.password.errors.append("External auth {user.external_auth} unavailable. Contact the admin.") validated = False self.user = user return validated diff --git a/newspipe/web/views/views.py b/newspipe/web/views/views.py index 7ff2a2e4..bb7bff2f 100644 --- a/newspipe/web/views/views.py +++ b/newspipe/web/views/views.py @@ -25,7 +25,7 @@ logger = logging.getLogger(__name__) @current_app.errorhandler(401) def authentication_required(error): - if application.conf["API_ROOT"] in request.url: + if application.config["API_ROOT"] in request.url: return error flash(gettext("Authentication required."), "info") return redirect(url_for("login")) @@ -33,7 +33,7 @@ def authentication_required(error): @current_app.errorhandler(403) def authentication_failed(error): - if application.conf["API_ROOT"] in request.url: + if application.config["API_ROOT"] in request.url: return error flash(gettext("Forbidden."), "danger") return redirect(url_for("login")) |