fix: render different form on login page
This commit is contained in:
parent
a1393ca3b8
commit
5c861df64c
@ -110,6 +110,7 @@
|
|||||||
"login": {
|
"login": {
|
||||||
"createAnAccount": "Create an account",
|
"createAnAccount": "Create an account",
|
||||||
"loginInstead": "Already have an account",
|
"loginInstead": "Already have an account",
|
||||||
|
"oidc": "Loin with OAuth",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"passwordConfirm": "Password Confirmation",
|
"passwordConfirm": "Password Confirmation",
|
||||||
"passwordsDontMatch": "Passwords don't match",
|
"passwordsDontMatch": "Passwords don't match",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="login" :class="{ recaptcha: recaptcha }">
|
<div id="login" :class="{ recaptcha: recaptcha }" v-if="authMethodJSON">
|
||||||
<form @submit="submit">
|
<form @submit="submit">
|
||||||
<img :src="logoURL" alt="File Browser" />
|
<img :src="logoURL" alt="File Browser" />
|
||||||
<h1>{{ name }}</h1>
|
<h1>{{ name }}</h1>
|
||||||
@ -41,11 +41,24 @@
|
|||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="login" v-else-if="authMethodOIDC">
|
||||||
|
<form @submit="submit">
|
||||||
|
<img :src="logoURL" alt="File Browser" />
|
||||||
|
<h1>{{ name }}</h1>
|
||||||
|
<div v-if="error !== ''" class="wrong">{{ error }}</div>
|
||||||
|
<input
|
||||||
|
class="button button--block"
|
||||||
|
type="submit"
|
||||||
|
:value="$t('login.oidc')"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as auth from "@/utils/auth";
|
import * as auth from "@/utils/auth";
|
||||||
import {
|
import {
|
||||||
|
authMethod,
|
||||||
name,
|
name,
|
||||||
logoURL,
|
logoURL,
|
||||||
recaptcha,
|
recaptcha,
|
||||||
@ -59,6 +72,8 @@ export default {
|
|||||||
signup: () => signup,
|
signup: () => signup,
|
||||||
name: () => name,
|
name: () => name,
|
||||||
logoURL: () => logoURL,
|
logoURL: () => logoURL,
|
||||||
|
authMethodJSON: () => authMethod === "json",
|
||||||
|
authMethodOIDC: () => authMethod === "oidc",
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
@ -87,6 +102,10 @@ export default {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
|
if (authMethod === 'oidc') {
|
||||||
|
return document.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
let redirect = this.$route.query.redirect;
|
let redirect = this.$route.query.redirect;
|
||||||
if (redirect === "" || redirect === undefined || redirect === null) {
|
if (redirect === "" || redirect === undefined || redirect === null) {
|
||||||
redirect = "/files/";
|
redirect = "/files/";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user