mirror of
https://github.com/immich-app/immich.git
synced 2025-11-27 00:59:58 +09:00
refactor(web,server): use feature flags for oauth (#3928)
* refactor: oauth to use feature flags * chore: open api * chore: e2e test for authorize endpoint
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import type { AxiosError, AxiosPromise } from 'axios';
|
||||
import {
|
||||
notificationController,
|
||||
@@ -32,9 +33,17 @@ export const oauth = {
|
||||
}
|
||||
return false;
|
||||
},
|
||||
authorize: async (location: Location) => {
|
||||
try {
|
||||
const redirectUri = location.href.split('?')[0];
|
||||
const { data } = await api.oauthApi.authorizeOAuth({ oAuthConfigDto: { redirectUri } });
|
||||
goto(data.url);
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to login with OAuth');
|
||||
}
|
||||
},
|
||||
getConfig: (location: Location) => {
|
||||
const redirectUri = location.href.split('?')[0];
|
||||
console.log(`OAuth Redirect URI: ${redirectUri}`);
|
||||
return api.oauthApi.generateConfig({ oAuthConfigDto: { redirectUri } });
|
||||
},
|
||||
login: (location: Location) => {
|
||||
|
||||
Reference in New Issue
Block a user