mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
* refactor: oauth to use feature flags * chore: open api * chore: e2e test for authorize endpoint
23 lines
588 B
TypeScript
23 lines
588 B
TypeScript
import { api, ServerFeaturesDto } from '@api';
|
|
import { writable } from 'svelte/store';
|
|
|
|
export type FeatureFlags = ServerFeaturesDto & { loaded: boolean };
|
|
|
|
export const featureFlags = writable<FeatureFlags>({
|
|
loaded: false,
|
|
clipEncode: true,
|
|
facialRecognition: true,
|
|
sidecar: true,
|
|
tagImage: true,
|
|
search: true,
|
|
oauth: false,
|
|
oauthAutoLaunch: false,
|
|
passwordLogin: true,
|
|
configFile: false,
|
|
});
|
|
|
|
export const loadFeatureFlags = async () => {
|
|
const { data } = await api.serverInfoApi.getServerFeatures();
|
|
featureFlags.update(() => ({ ...data, loaded: true }));
|
|
};
|