Fix: don't show register if new users not allowed (#3010)

* enforce allow new user flag on UI
* chore: bundle
* ensure we get a boolean

---------

Co-authored-by: dni  <office@dnilabs.com>
This commit is contained in:
Tiago Vasconcelos
2025-03-03 12:53:58 +01:00
committed by GitHub
co-authored by dni ⚡
parent c5964436b5
commit fe9b62e8a8
5 changed files with 30 additions and 9 deletions
+17 -4
View File
@@ -59,6 +59,9 @@
}
}
</style>
<script>
const ALLOWED_REGISTER = {{ LNBITS_NEW_ACCOUNTS_ALLOWED | tojson }};
</script>
<script src="{{ static_url_for('static', 'js/index.js') }}"></script>
{% endblock %} {% block page_container %}
<q-page-container>
@@ -145,7 +148,7 @@
{%else%}
<username-password
v-if="authMethod != 'user-id-only'"
:allowed_new_users="{{ LNBITS_NEW_ACCOUNTS_ALLOWED | tojson }}"
:allowed_new_users="allowedRegister"
:auth-methods="{{ LNBITS_AUTH_METHODS }}"
:auth-action="authAction"
v-model:user-name="username"
@@ -160,7 +163,10 @@
class="text-center text-grey-6"
v-if="authAction !== 'reset'"
>
<p v-if="authAction === 'login'" class="q-mb-none">
<p
v-if="authAction === 'login' && allowedRegister"
class="q-mb-none"
>
Not registered? Create an
<span
class="text-secondary cursor-pointer"
@@ -168,7 +174,14 @@
>Account</span
>
</p>
<p v-else class="q-mb-none">
<p
v-else-if="authAction === 'login' && !allowedRegister"
class="q-mb-none"
>
<span v-text="$t('new_user_not_allowed')"></span>
</p>
<p v-else-if="authAction === 'register'" class="q-mb-none">
Aready have an account?
<span
class="text-secondary cursor-pointer"
@@ -180,7 +193,7 @@
</username-password>
{% if "user-id-only" in LNBITS_AUTH_METHODS %}
<user-id-only
:allowed_new_users="{{ LNBITS_NEW_ACCOUNTS_ALLOWED | tojson }}"
:allowed_new_users="allowedRegister"
v-model:usr="usr"
v-model:wallet="walletName"
:auth-action="authAction"