diff --git a/src/views/pages/auth/Callback.vue b/src/views/pages/auth/Callback.vue index 265b7d3..109c0d4 100644 --- a/src/views/pages/auth/Callback.vue +++ b/src/views/pages/auth/Callback.vue @@ -1,12 +1,13 @@ - Redirecting... + {{message}} \ No newline at end of file diff --git a/src/views/pages/auth/Login.vue b/src/views/pages/auth/Login.vue index aeefd0b..6a47365 100644 --- a/src/views/pages/auth/Login.vue +++ b/src/views/pages/auth/Login.vue @@ -35,7 +35,7 @@ const loginAD = async () => { console.log("Token " ,token) axios.post("/msauth/exchange",{}, { - headers: { Authorization: `Bearer ${token.accessToken}` } + headers: { Authorization: `Bearer ${token.accessToken}` } }).then(res=>{ console.log("Token exhange done :",res.data.token) if(res.data.token){ @@ -48,11 +48,28 @@ const loginAD = async () => { } else { router.push({ name: 'scenario-list' }); } - }) + + }).catch(res=>{ + console.log("Error on token exchange:",res) + error.value = "Error authenticating on the application. Did you ask for authorization?" + visible.value = true; + + }); }else{ + error.value = "Error authenticating on the application. Did you ask for authorization?" + visible.value = true; + console.error("No token exchange with backend") } - }) + + + }).catch(res=>{ + console.log("Error on token exchange:",res) + error.value = "Error authenticating on the application. Did you ask for authorization?" + visible.value = true; + + }); + } const loginMsal = async () => { @@ -60,6 +77,18 @@ const loginMsal = async () => { msalInstance.loginRedirect(msalrequest) } +const logoutAD = async () => { + const logoutRequest = { + account: msaccount.value, + mainWindowRedirectUri:window.location.href, + }; + await msalInstance.logoutPopup(logoutRequest); +} + + + + + const login_old = async () => { try { await auth.login({ @@ -94,13 +123,13 @@ const login_old = async () => { - - + - + { fill="var(--primary-color)" mask="url(#path-2-inside-1)" /> - - - - Welcome to - WizardAI - WORKFLOW + - - Username - - - Password - - - - - - - {{ error }} - + + Welcome to + WizardAI - WORKFLOW + + + + Username + + + Password + + + + + + + + + Sign in with Microsoft Azure AD + + + + + + + + + + + + + + + {{ error }} +