mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
689fd7cb95
We now extend the default Eslint configuration and enforce styling with prettier for all of our frontend code.
16 lines
553 B
TypeScript
16 lines
553 B
TypeScript
import { Configuration } from "../models/Configuration";
|
|
import { ConfigurationPath } from "./Api";
|
|
import { Get } from "./Client";
|
|
import { toEnum, Method2FA } from "./UserPreferences";
|
|
|
|
interface ConfigurationPayload {
|
|
available_methods: Method2FA[];
|
|
second_factor_enabled: boolean;
|
|
totp_period: number;
|
|
}
|
|
|
|
export async function getConfiguration(): Promise<Configuration> {
|
|
const config = await Get<ConfigurationPayload>(ConfigurationPath);
|
|
return { ...config, available_methods: new Set(config.available_methods.map(toEnum)) };
|
|
}
|