diff --git a/demoBackend/src/demo-website/src/components/Login.vue b/demoBackend/src/demo-website/src/components/Login.vue index 210aa6e..ed3db41 100644 --- a/demoBackend/src/demo-website/src/components/Login.vue +++ b/demoBackend/src/demo-website/src/components/Login.vue @@ -7,9 +7,10 @@

Read more from here.

-
- +
+
+
-
+
@@ -39,14 +40,11 @@ import router from "@/router"; export default { name: 'LoginComponent', - props: { - "csrftoken": String, - "csrfHeaderName": String, - }, data() { return { useAndroidApp: true, loading: false, + challenge: "", } }, methods: { @@ -58,6 +56,8 @@ export default { this.useAndroidApp = false; }, + + authenticate: async function () { this.loading = true; @@ -69,7 +69,6 @@ export default { headers: { "sessionId": this.$store.getters.getSessionId }, - }; console.log(options); @@ -78,7 +77,7 @@ export default { const response = await webeid.authenticate(options); console.log("Authentication successful! Response:", response); this.loading = false; - this.$store.commit("setLoggedIn", true); + this.$store.dispatch("setLoggedIn", true); await router.push("welcome"); } catch (error) { @@ -95,7 +94,14 @@ export default { }, loading() { return this.loading; + }, + isAndroidDevice() { + return this.$store.getters.getIsAndroid } + }, + mounted() { + const isAndroid = webeid.isAndroidDevice(); + this.$store.dispatch("setIsAndroid", isAndroid); } } diff --git a/demoBackend/src/demo-website/src/components/Navbar.vue b/demoBackend/src/demo-website/src/components/Navbar.vue index dbc1942..604f4c4 100644 --- a/demoBackend/src/demo-website/src/components/Navbar.vue +++ b/demoBackend/src/demo-website/src/components/Navbar.vue @@ -31,23 +31,21 @@ export default { fetch("/auth/logout", requestOptions) .then((response) => { console.log(response); - this.$store.commit("setLoggedIn", false); + this.$store.dispatch("setLoggedIn", false); router.push("/"); } ) } }, mounted() { - if (this.$store.getters.getSessionId == null) { - const sessionId = this.$cookie.getCookie("JSESSIONID"); - this.$store.dispatch("fetchSessionId", sessionId); - } + const sessionId = this.$cookie.getCookie("JSESSIONID"); + this.$store.dispatch("fetchSessionId", sessionId); } } \ No newline at end of file diff --git a/demoBackend/src/demo-website/src/components/Welcome.vue b/demoBackend/src/demo-website/src/components/Welcome.vue index fd86c45..0e90422 100644 --- a/demoBackend/src/demo-website/src/components/Welcome.vue +++ b/demoBackend/src/demo-website/src/components/Welcome.vue @@ -1,8 +1,11 @@