mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
setting for sso login
This commit is contained in:
parent
34a15ff51f
commit
e255f2bf42
@ -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:
|
||||
|
@ -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 %}
|
||||
|
@ -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'>
|
||||
|
Loading…
Reference in New Issue
Block a user