Hide the login form if no api url is configured

This commit is contained in:
kolaente 2021-04-21 09:44:40 +02:00
parent fa5b1807c7
commit 8d04bdc4f0
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 6 additions and 3 deletions

View file

@ -189,6 +189,7 @@ export default {
localStorage.setItem('API_URL', window.API_URL) localStorage.setItem('API_URL', window.API_URL)
this.configureApi = false this.configureApi = false
this.apiUrl = window.API_URL this.apiUrl = window.API_URL
this.$emit('foundApi', this.apiUrl)
} }
}) })
}, },

View file

@ -5,8 +5,8 @@
<div class="notification is-success has-text-centered" v-if="confirmedEmailSuccess"> <div class="notification is-success has-text-centered" v-if="confirmedEmailSuccess">
You successfully confirmed your email! You can log in now. You successfully confirmed your email! You can log in now.
</div> </div>
<api-config/> <api-config @foundApi="hasApiUrl = true"/>
<form @submit.prevent="submit" id="loginform" v-if="localAuthEnabled"> <form @submit.prevent="submit" id="loginform" v-if="hasApiUrl && localAuthEnabled">
<div class="field"> <div class="field">
<label class="label" for="username">Username Or Email Address</label> <label class="label" for="username">Username Or Email Address</label>
<div class="control"> <div class="control">
@ -82,7 +82,7 @@
</div> </div>
</form> </form>
<div v-if="openidConnect.enabled && openidConnect.providers && openidConnect.providers.length > 0" class="mt-4"> <div v-if="hasApiUrl && openidConnect.enabled && openidConnect.providers && openidConnect.providers.length > 0" class="mt-4">
<x-button <x-button
@click="redirectToProvider(p)" @click="redirectToProvider(p)"
v-for="(p, k) in openidConnect.providers" v-for="(p, k) in openidConnect.providers"
@ -117,6 +117,7 @@ export default {
data() { data() {
return { return {
confirmedEmailSuccess: false, confirmedEmailSuccess: false,
hasApiUrl: false,
} }
}, },
beforeMount() { beforeMount() {
@ -144,6 +145,7 @@ export default {
} }
}, },
created() { created() {
this.hasApiUrl = window.API_URL !== ''
this.setTitle('Login') this.setTitle('Login')
}, },
computed: mapState({ computed: mapState({