mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
* feat(web): SPA * chore: remove unnecessary prune * feat(web): merge with immich-server * Correct method name * fix: bugs, docs, workflows, etc. * chore: keep dockerignore for dev * chore: remove license * fix: expose 2283 --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { SystemConfigService } from '@app/domain';
|
|
import axios from 'axios';
|
|
import { Command, CommandRunner } from 'nest-commander';
|
|
|
|
@Command({
|
|
name: 'enable-password-login',
|
|
description: 'Enable password login',
|
|
})
|
|
export class EnablePasswordLoginCommand extends CommandRunner {
|
|
constructor(private configService: SystemConfigService) {
|
|
super();
|
|
}
|
|
|
|
async run(): Promise<void> {
|
|
const config = await this.configService.getConfig();
|
|
config.passwordLogin.enabled = true;
|
|
await this.configService.updateConfig(config);
|
|
await axios.post('http://localhost:3001/api/refresh-config');
|
|
console.log('Password login has been enabled.');
|
|
}
|
|
}
|
|
|
|
@Command({
|
|
name: 'disable-password-login',
|
|
description: 'Disable password login',
|
|
})
|
|
export class DisablePasswordLoginCommand extends CommandRunner {
|
|
constructor(private configService: SystemConfigService) {
|
|
super();
|
|
}
|
|
|
|
async run(): Promise<void> {
|
|
const config = await this.configService.getConfig();
|
|
config.passwordLogin.enabled = false;
|
|
await this.configService.updateConfig(config);
|
|
await axios.post('http://localhost:3001/api/refresh-config');
|
|
console.log('Password login has been disabled.');
|
|
}
|
|
}
|