Add showing openid providers on login
This commit is contained in:
parent
769a18c29d
commit
a3541ac1e9
|
@ -54,15 +54,16 @@
|
||||||
|
|
||||||
<div class="field is-grouped login-buttons">
|
<div class="field is-grouped login-buttons">
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
<button class="button is-primary" type="submit" v-bind:class="{ 'is-loading': loading}">Login
|
<button class="button is-primary" type="submit" v-bind:class="{ 'is-loading': loading}">
|
||||||
|
Login
|
||||||
</button>
|
</button>
|
||||||
<router-link :to="{ name: 'user.register' }" class="button" v-if="registrationEnabled">Register
|
<router-link :to="{ name: 'user.register' }" class="button" v-if="registrationEnabled">
|
||||||
|
Register
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<router-link :to="{ name: 'user.password-reset.request' }" class="reset-password-link">Reset
|
<router-link :to="{ name: 'user.password-reset.request' }" class="reset-password-link">
|
||||||
your
|
Reset your password
|
||||||
password
|
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,6 +71,13 @@
|
||||||
{{ errorMessage }}
|
{{ errorMessage }}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<div v-if="openidConnect.enabled && openidConnect.providers.length > 0" class="mt-4">
|
||||||
|
<a @click="redirectToProvider(p)" v-for="(p, k) in openidConnect.providers" :key="k" class="button is-fullwidth">
|
||||||
|
Log in with {{ p.name }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<legal/>
|
<legal/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -128,6 +136,8 @@ export default {
|
||||||
errorMessage: ERROR_MESSAGE,
|
errorMessage: ERROR_MESSAGE,
|
||||||
needsTotpPasscode: state => state.auth.needsTotpPasscode,
|
needsTotpPasscode: state => state.auth.needsTotpPasscode,
|
||||||
authenticated: state => state.auth.authenticated,
|
authenticated: state => state.auth.authenticated,
|
||||||
|
localAuthEnabled: state => state.config.auth.enabled,
|
||||||
|
openidConnect: state => state.config.auth.openidConnect,
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
submit() {
|
submit() {
|
||||||
|
@ -151,6 +161,12 @@ export default {
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
redirectToProvider(provider) {
|
||||||
|
const state = Math.random().toString(36).substring(2, 24)
|
||||||
|
localStorage.setItem('state', state)
|
||||||
|
|
||||||
|
window.location.href = `${provider.authUrl}?client_id=${provider.clientId}&redirect_uri=${this.openidConnect.redirectUrl}${provider.key}&response_type=code&scope=&state=${state}`
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Reference in New Issue
Block a user