Skip to content
Snippets Groups Projects
Commit 4701c604 authored by Lars Mikkel Lødeng Nilsen's avatar Lars Mikkel Lødeng Nilsen
Browse files

chore: Added router.push to methods in userStore

parent e2d1c20a
No related branches found
No related tags found
3 merge requests!66Final merge,!37Feat/biologin,!4Pipeline fix
......@@ -42,7 +42,7 @@ export const useUserStore = defineStore('user', () => {
user.value.lastname = lastname
user.value.username = username
router.push({ name: 'configurations1' })
router.push({ name: 'addAlternativeLogin' })
})
.catch((error) => {
const axiosError = error as AxiosError
......@@ -80,7 +80,7 @@ export const useUserStore = defineStore('user', () => {
router.push({ name: 'login' })
}
const registerPasskey = async () => {
const bioRegister = async () => {
try {
const response = await authInterceptor.post("/auth/bioRegistration");
initialCheckStatus(response);
......@@ -117,8 +117,10 @@ export const useUserStore = defineStore('user', () => {
clientExtensionResults: publicKeyCredential.getClientExtensionResults(),
};
await authInterceptor.post("/auth/finishBioRegistration", { credential: JSON.stringify(encodedResult) });
await authInterceptor.post("/auth/finishBioRegistration", { credential: JSON.stringify(encodedResult) })
.then(response => { router.push({ name: 'configurations1' }) });
} catch (error) {
router.push({ name: 'configurations1' })
console.error(error);
}
}
......@@ -192,6 +194,7 @@ export const useUserStore = defineStore('user', () => {
login,
logout,
bioLogin,
bioRegister,
errorMessage
}
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment