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,
|
'default': False,
|
||||||
'validator': bool,
|
'validator': bool,
|
||||||
},
|
},
|
||||||
|
'LOGIN_ENABLE_SSO': {
|
||||||
|
'name': _('Enable SSO'),
|
||||||
|
'description': _('Enable SSO on the login-pages'),
|
||||||
|
'default': False,
|
||||||
|
'validator': bool,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
{% settings_value 'LOGIN_ENABLE_REG' as enable_reg %}
|
{% settings_value 'LOGIN_ENABLE_REG' as enable_reg %}
|
||||||
{% settings_value 'LOGIN_ENABLE_PWD_FORGOT' as enable_pwd_forgot %}
|
{% settings_value 'LOGIN_ENABLE_PWD_FORGOT' as enable_pwd_forgot %}
|
||||||
|
{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}
|
||||||
|
|
||||||
<h1>{% trans "Sign In" %}</h1>
|
<h1>{% trans "Sign In" %}</h1>
|
||||||
|
|
||||||
@ -38,12 +39,13 @@ for a account and sign in below:{% endblocktrans %}</p>
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
{% if enable_sso %}
|
||||||
<br>
|
<br>
|
||||||
<h4 class="text-center">{% trans 'or use SSO' %}</h4>
|
<h4 class="text-center">{% trans 'or use SSO' %}</h4>
|
||||||
<div>
|
<div>
|
||||||
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
|
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
|
||||||
</div>
|
</div>
|
||||||
{% include "socialaccount/snippets/login_extra.html" %}
|
{% include "socialaccount/snippets/login_extra.html" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% settings_value 'LOGIN_ENABLE_REG' as enable_reg %}
|
{% settings_value 'LOGIN_ENABLE_REG' as enable_reg %}
|
||||||
|
{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}
|
||||||
|
|
||||||
<h1>{% trans "Sign Up" %}</h1>
|
<h1>{% trans "Sign Up" %}</h1>
|
||||||
|
|
||||||
@ -21,12 +22,14 @@
|
|||||||
<button type="submit" class="btn btn-primary btn-block">{% trans "Sign Up" %}</button>
|
<button type="submit" class="btn btn-primary btn-block">{% trans "Sign Up" %}</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
{% if enable_sso %}
|
||||||
<br>
|
<br>
|
||||||
<h4>{% trans 'Or use a SSO-provider for signup' %}</h4>
|
<h4>{% trans 'Or use a SSO-provider for signup' %}</h4>
|
||||||
<div>
|
<div>
|
||||||
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
|
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
|
||||||
</div>
|
</div>
|
||||||
{% include "socialaccount/snippets/login_extra.html" %}
|
{% include "socialaccount/snippets/login_extra.html" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class='alert alert-block alert-danger'>
|
<div class='alert alert-block alert-danger'>
|
||||||
|
Loading…
Reference in New Issue
Block a user