Skip to content

Commit

Permalink
feat(auth): setup a basic oidc callback error view with retry button
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Feb 5, 2021
1 parent ff73a3c commit 931d5d0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 10 deletions.
11 changes: 5 additions & 6 deletions src/i18n/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default {
yes: "Yes"
},
oidc: {
callbackMessage: "OIDC callback message",
callbackErrorMessage: "OIDC callback error message"
callbackErrorMessage: "An error occured during authentication...",
tryAgain: "Try Again"
},
Header: {
selectLanguage: "Choose a language",
Expand Down Expand Up @@ -77,10 +77,9 @@ export default {
errorMessage: "Invalid project name."
},
ProjectDeleteGuard: {
title: "Supprimer le projet",
message:
"Êtes vous sûr de vouloir supprimer (définitivement) ce projet ?",
buttonDelete: "Supprimer"
title: "Delete project",
message: "Are you sure you want to (permanently) delete this project ?",
buttonDelete: "Delete"
}
}
};
5 changes: 3 additions & 2 deletions src/i18n/lang/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ export default {
yes: "Oui"
},
oidc: {
callbackMessage: "OIDC callback message",
callbackErrorMessage: "OIDC callback error message"
callbackErrorMessage:
"Une erreur s'est produite lors de l'authentification...",
tryAgain: "Réessayer"
},
Header: {
selectLanguage: "Sélectionner la langue",
Expand Down
2 changes: 1 addition & 1 deletion src/router/guards.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const authGuard = async (to, from, next) => {
next();
} else if (to.matched.some(r => r.meta.requiresAuth)) {
await authenticate(to.path);
next();
next(isAuthenticated.value);
} else {
next();
}
Expand Down
8 changes: 8 additions & 0 deletions src/views/oidc-callback-error/OidcCallbackError.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.oidc-callback-error-view {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
28 changes: 27 additions & 1 deletion src/views/oidc-callback-error/OidcCallbackError.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
<template>
<div class="oidc-callback-error-view">
{{ $t("oidc.callbackErrorMessage") }}
<h1>{{ $t("oidc.callbackErrorMessage") }}</h1>
<BIMDataButton fill radius color="primary" @click="goToRoot">
{{ $t("oidc.tryAgain") }}
</BIMDataButton>
</div>
</template>

<script>
import { useRouter } from "vue-router";
// Components
import BIMDataButton from "@bimdata/design-system/dist/js/BIMDataComponents/vue3/BIMDataButton.js";
export default {
components: {
BIMDataButton
},
setup() {
const router = useRouter();
const goToRoot = () => router.push("/");
return {
goToRoot
};
}
};
</script>

<style scoped lang="scss" src="./OidcCallbackError.scss"></style>

0 comments on commit 931d5d0

Please sign in to comment.