fix: indentation and quotation
This commit is contained in:
parent
23f71b184f
commit
08405e8c81
@ -142,7 +142,7 @@ export default {
|
|||||||
version: () => version,
|
version: () => version,
|
||||||
disableExternal: () => disableExternal,
|
disableExternal: () => disableExternal,
|
||||||
disableUsedPercentage: () => disableUsedPercentage,
|
disableUsedPercentage: () => disableUsedPercentage,
|
||||||
canLogout: () => (!noAuth && loginPage) || authMethod === "oidc"
|
canLogout: () => (!noAuth && loginPage) || authMethod === "oidc",
|
||||||
},
|
},
|
||||||
asyncComputed: {
|
asyncComputed: {
|
||||||
usage: {
|
usage: {
|
||||||
|
|||||||
@ -21,9 +21,9 @@ export function parseToken(token) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function validateLogin() {
|
export async function validateLogin() {
|
||||||
let jwt = localStorage.getItem("jwt")
|
let jwt = localStorage.getItem("jwt");
|
||||||
|
|
||||||
if (authMethod === 'oidc' && (!jwt || jwt === "null")) {
|
if (authMethod === "oidc" && (!jwt || jwt === "null")) {
|
||||||
jwt = cookie("auth");
|
jwt = cookie("auth");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +48,6 @@ export async function login(username, password, recaptcha) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const body = await res.text();
|
const body = await res.text();
|
||||||
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
parseToken(body);
|
parseToken(body);
|
||||||
} else {
|
} else {
|
||||||
@ -69,7 +68,7 @@ export async function renew(jwt) {
|
|||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
parseToken(body);
|
parseToken(body);
|
||||||
} else {
|
} else {
|
||||||
if (authMethod === 'oidc') {
|
if (authMethod === "oidc") {
|
||||||
clearLoginState();
|
clearLoginState();
|
||||||
document.location.replace(document.location.pathname);
|
document.location.replace(document.location.pathname);
|
||||||
}
|
}
|
||||||
@ -103,4 +102,4 @@ function clearLoginState() {
|
|||||||
store.commit("setJWT", "");
|
store.commit("setJWT", "");
|
||||||
store.commit("setUser", null);
|
store.commit("setUser", null);
|
||||||
localStorage.setItem("jwt", null);
|
localStorage.setItem("jwt", null);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,9 +47,9 @@
|
|||||||
<h1>{{ name }}</h1>
|
<h1>{{ name }}</h1>
|
||||||
<div v-if="error !== ''" class="wrong">{{ error }}</div>
|
<div v-if="error !== ''" class="wrong">{{ error }}</div>
|
||||||
<input
|
<input
|
||||||
class="button button--block"
|
class="button button--block"
|
||||||
type="submit"
|
type="submit"
|
||||||
:value="$t('login.oidc')"
|
:value="$t('login.oidc')"
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -102,7 +102,7 @@ export default {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
if (authMethod === 'oidc') {
|
if (authMethod === "oidc") {
|
||||||
return document.location.reload();
|
return document.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user