fix: indentation and quotation

This commit is contained in:
Marcell FÜLÖP 2023-02-20 21:47:52 +00:00
parent 23f71b184f
commit 08405e8c81
3 changed files with 9 additions and 10 deletions

View File

@ -142,7 +142,7 @@ export default {
version: () => version,
disableExternal: () => disableExternal,
disableUsedPercentage: () => disableUsedPercentage,
canLogout: () => (!noAuth && loginPage) || authMethod === "oidc"
canLogout: () => (!noAuth && loginPage) || authMethod === "oidc",
},
asyncComputed: {
usage: {

View File

@ -21,9 +21,9 @@ export function parseToken(token) {
}
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");
}
@ -48,7 +48,6 @@ export async function login(username, password, recaptcha) {
});
const body = await res.text();
if (res.status === 200) {
parseToken(body);
} else {
@ -69,7 +68,7 @@ export async function renew(jwt) {
if (res.status === 200) {
parseToken(body);
} else {
if (authMethod === 'oidc') {
if (authMethod === "oidc") {
clearLoginState();
document.location.replace(document.location.pathname);
}
@ -103,4 +102,4 @@ function clearLoginState() {
store.commit("setJWT", "");
store.commit("setUser", null);
localStorage.setItem("jwt", null);
}
}

View File

@ -47,9 +47,9 @@
<h1>{{ name }}</h1>
<div v-if="error !== ''" class="wrong">{{ error }}</div>
<input
class="button button--block"
type="submit"
:value="$t('login.oidc')"
class="button button--block"
type="submit"
:value="$t('login.oidc')"
/>
</form>
</div>
@ -102,7 +102,7 @@ export default {
event.preventDefault();
event.stopPropagation();
if (authMethod === 'oidc') {
if (authMethod === "oidc") {
return document.location.reload();
}