diff --git a/frontend/src/i18n/lang/en.json b/frontend/src/i18n/lang/en.json index 699c01094..28e185a4a 100644 --- a/frontend/src/i18n/lang/en.json +++ b/frontend/src/i18n/lang/en.json @@ -54,6 +54,7 @@ "authenticating": "Authenticating…", "openIdStateError": "State does not match, refusing to continue!", "openIdGeneralError": "An error occurred while authenticating against the third party.", + "oauthMissingParams": "Missing required OAuth parameters: {params}", "logout": "Logout", "emailInvalid": "Please enter a valid email address.", "usernameRequired": "Please provide a username.", diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index c19b4642d..1f4b15121 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -394,6 +394,11 @@ const router = createRouter({ name: 'openid.auth', component: OpenIdAuth, }, + { + path: '/oauth/authorize', + name: 'oauth.authorize', + component: () => import('@/views/user/OAuthAuthorize.vue'), + }, { path: '/about', name: 'about', diff --git a/frontend/src/views/user/Login.vue b/frontend/src/views/user/Login.vue index 9eda9088a..29ee5c90f 100644 --- a/frontend/src/views/user/Login.vue +++ b/frontend/src/views/user/Login.vue @@ -217,6 +217,7 @@ async function submit() { try { await authStore.login(credentials) authStore.setNeedsTotpPasscode(false) + redirectIfSaved() } catch (e) { if (e.response?.data.code === 1017 && !credentials.totpPasscode) { diff --git a/frontend/src/views/user/OAuthAuthorize.vue b/frontend/src/views/user/OAuthAuthorize.vue new file mode 100644 index 000000000..49318d55f --- /dev/null +++ b/frontend/src/views/user/OAuthAuthorize.vue @@ -0,0 +1,77 @@ + + + diff --git a/frontend/src/views/user/OpenIdAuth.vue b/frontend/src/views/user/OpenIdAuth.vue index 33268c80b..e581aaee2 100644 --- a/frontend/src/views/user/OpenIdAuth.vue +++ b/frontend/src/views/user/OpenIdAuth.vue @@ -80,8 +80,9 @@ async function authenticateWithCode() { provider: route.params.provider, code: route.query.code, }) + redirectIfSaved() - } catch(e) { + } catch (e) { errorMessage.value = getErrorText(e) } finally { localStorage.removeItem('authenticating')