2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

[SSO] Separate settings for local and social signup (#4171)

* [SSO] Separate settings for local and social signup
Fixes #4166

* make registration setting configruable

* extend docstring

* add setting to settigns screen

* update check ref

* both settign most be checked
This commit is contained in:
Matthias Mair
2023-01-09 14:20:05 +01:00
committed by GitHub
parent 0ed2aa3a4d
commit ac92471dcb
4 changed files with 17 additions and 5 deletions

View File

@ -27,6 +27,7 @@
<td colspan='4'></td>
</tr>
{% include "InvenTree/settings/setting.html" with key="LOGIN_ENABLE_REG" icon="fa-user-plus" %}
{% include "InvenTree/settings/setting.html" with key="LOGIN_ENABLE_SSO_REG" icon="fa-user-plus" %}
{% include "InvenTree/settings/setting.html" with key="LOGIN_SIGNUP_MAIL_TWICE" icon="fa-at" %}
{% include "InvenTree/settings/setting.html" with key="LOGIN_SIGNUP_PWD_TWICE" icon="fa-user-lock" %}
{% include "InvenTree/settings/setting.html" with key="SIGNUP_GROUP" icon="fa-users" %}

View File

@ -6,7 +6,7 @@
{% block content %}
{% settings_value 'LOGIN_ENABLE_REG' as enable_reg %}
{% settings_value 'LOGIN_ENABLE_SSO' as enable_sso %}
{% settings_value 'LOGIN_ENABLE_SSO_REG' as enable_sso %}
<h3>{% trans "Sign Up" %}</h3>
@ -21,17 +21,18 @@
{% endif %}
<button type="submit" class="btn btn-primary btn-block">{% trans "Sign Up" %}</button>
</form>
{% endif %}
{% if enable_sso %}
<br>
<h4>{% trans 'Or use a SSO-provider for signup' %}</h4>
<h4>{% trans '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 %}
{% if not enable_reg and not enable_sso %}
<div class='alert alert-block alert-danger'>
<p>{% trans "This function is currently disabled. Please contact an administrator." %}</p>
</div>