diff options
| author | Clement Michaud <clement.michaud34@gmail.com> | 2019-11-19 00:37:36 +0100 | 
|---|---|---|
| committer | Clément Michaud <clement.michaud34@gmail.com> | 2019-12-05 11:05:24 +0100 | 
| commit | 9ae2096d2a0840dc0a14925f8b1a9a7c3af715c2 (patch) | |
| tree | fee8a46bd77119e4f240c652e332cde099cbeebd /web/src/services/Configuration.ts | |
| parent | 05129207a2206550c42342f3f6a45d02a3a35f17 (diff) | |
Rewrite authelia frontend to improve user experience.
This refactoring simplify the code of the frontend and prepare the
portal for receiving a user settings page and an admin page.
Diffstat (limited to 'web/src/services/Configuration.ts')
| -rw-r--r-- | web/src/services/Configuration.ts | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/web/src/services/Configuration.ts b/web/src/services/Configuration.ts new file mode 100644 index 000000000..47eb0425b --- /dev/null +++ b/web/src/services/Configuration.ts @@ -0,0 +1,9 @@ +import { Get } from "./Client"; +import { Available2FAMethodsPath } from "./Api"; +import { Method2FA, toEnum } from "./UserPreferences"; +import { Configuration } from "../models/Configuration"; + +export async function getAvailable2FAMethods(): Promise<Configuration> { +    const methods = await Get<Method2FA[]>(Available2FAMethodsPath); +    return new Set(methods.map(toEnum)); +}
\ No newline at end of file  | 
