mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
d9e487c99f
Displaying only one option at 2FA stage will allow to add more options like DUO push or OAuth. The user can switch to other option and in this case the option is remembered so that next time, the user will see the same option. The latest option is considered as the prefered option by Authelia.
26 lines
748 B
TypeScript
26 lines
748 B
TypeScript
import fs from 'fs';
|
|
import AutheliaServerWithHotReload from "./AutheliaServerWithHotReload";
|
|
import AutheliaServerInterface from './AutheliaServerInterface';
|
|
import AutheliaServerFromDist from './AutheliaServerFromDist';
|
|
|
|
class AutheliaServer implements AutheliaServerInterface {
|
|
private runnerImpl: AutheliaServerInterface;
|
|
|
|
constructor(configPath: string, watchPaths: string[] = []) {
|
|
if (fs.existsSync('.suite')) {
|
|
this.runnerImpl = new AutheliaServerWithHotReload(configPath, watchPaths);
|
|
} else {
|
|
this.runnerImpl = new AutheliaServerFromDist(configPath, true);
|
|
}
|
|
}
|
|
|
|
async start() {
|
|
await this.runnerImpl.start();
|
|
}
|
|
|
|
async stop() {
|
|
await this.runnerImpl.stop();
|
|
}
|
|
}
|
|
|
|
export default AutheliaServer; |