setting for sso login

This commit is contained in:
Matthias 2021-09-05 20:20:57 +02:00
parent 34a15ff51f
commit e255f2bf42
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
3 changed files with 12 additions and 1 deletions

View File

@ -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:

View File

@ -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 %}
<h1>{% trans "Sign In" %}</h1>
@ -38,12 +39,13 @@ for a account and sign in below:{% endblocktrans %}</p>
</div>
</form>
{% if enable_sso %}
<br>
<h4 class="text-center">{% trans 'or use SSO' %}</h4>
<div>
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</div>
{% include "socialaccount/snippets/login_extra.html" %}
{% endif %}
{% endblock %}

View File

@ -6,6 +6,7 @@
{% block content %}
{% settings_value 'LOGIN_ENABLE_REG' as enable_reg %}
{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}
<h1>{% trans "Sign Up" %}</h1>
@ -21,12 +22,14 @@
<button type="submit" class="btn btn-primary btn-block">{% trans "Sign Up" %}</button>
</form>
{% if enable_sso %}
<br>
<h4>{% trans 'Or use a SSO-provider for signup' %}</h4>
<div>
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</div>
{% include "socialaccount/snippets/login_extra.html" %}
{% endif %}
{% else %}
<div class='alert alert-block alert-danger'>