From e255f2bf42c3edd046f566f5478fb1c2dae4662a Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 5 Sep 2021 20:20:57 +0200 Subject: [PATCH] setting for sso login --- InvenTree/common/models.py | 6 ++++++ InvenTree/templates/account/login.html | 4 +++- InvenTree/templates/account/signup.html | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 6d75186c95..74d6b02f2f 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -840,6 +840,12 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'default': False, 'validator': bool, }, + 'LOGIN_ENABLE_SSO': { + 'name': _('Enable SSO'), + 'description': _('Enable SSO on the login-pages'), + 'default': False, + 'validator': bool, + }, } class Meta: diff --git a/InvenTree/templates/account/login.html b/InvenTree/templates/account/login.html index 33bc15b526..574cfa01f3 100644 --- a/InvenTree/templates/account/login.html +++ b/InvenTree/templates/account/login.html @@ -8,6 +8,7 @@ {% settings_value 'LOGIN_ENABLE_REG' as enable_reg %} {% settings_value 'LOGIN_ENABLE_PWD_FORGOT' as enable_pwd_forgot %} +{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}

{% trans "Sign In" %}

@@ -38,12 +39,13 @@ for a account and sign in below:{% endblocktrans %}

- +{% if enable_sso %}

{% trans 'or use SSO' %}

{% include "socialaccount/snippets/provider_list.html" with process="login" %}
{% include "socialaccount/snippets/login_extra.html" %} +{% endif %} {% endblock %} diff --git a/InvenTree/templates/account/signup.html b/InvenTree/templates/account/signup.html index c72a09502a..f2972ba30b 100644 --- a/InvenTree/templates/account/signup.html +++ b/InvenTree/templates/account/signup.html @@ -6,6 +6,7 @@ {% block content %} {% settings_value 'LOGIN_ENABLE_REG' as enable_reg %} +{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}

{% trans "Sign Up" %}

@@ -21,12 +22,14 @@ +{% if enable_sso %}

{% trans 'Or use a SSO-provider for signup' %}

{% include "socialaccount/snippets/provider_list.html" with process="login" %}
{% include "socialaccount/snippets/login_extra.html" %} +{% endif %} {% else %}