mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
fix(web): oauth login (#6813)
This commit is contained in:
parent
d2c2db2595
commit
7a075d78a3
2 changed files with 2 additions and 3 deletions
|
@ -1,4 +1,3 @@
|
|||
import { goto } from '$app/navigation';
|
||||
import type { AxiosError, AxiosPromise } from 'axios';
|
||||
import {
|
||||
notificationController,
|
||||
|
@ -45,7 +44,7 @@ export const oauth = {
|
|||
try {
|
||||
const redirectUri = location.href.split('?')[0];
|
||||
const { data } = await api.oauthApi.startOAuth({ oAuthConfigDto: { redirectUri } });
|
||||
goto(data.url);
|
||||
window.location.href = data.url;
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to login with OAuth');
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
export let data: PageData;
|
||||
|
||||
afterNavigate(async ({ from }) => {
|
||||
if (from?.url.pathname === AppRoute.AUTH_CHANGE_PASSWORD) {
|
||||
if (from?.url?.pathname === AppRoute.AUTH_CHANGE_PASSWORD) {
|
||||
resetSavedUser();
|
||||
await api.authenticationApi.logout();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue