refactor: move static methods into util

This commit is contained in:
izzy 2025-11-10 11:32:49 +00:00
parent db22797ae6
commit 36baeb603f
No known key found for this signature in database
GPG key ID: 5059F398521BB0F6
7 changed files with 92 additions and 95 deletions

View file

@ -20,11 +20,7 @@ export class MaintenanceController {
@Post('start')
@Authenticated({ permission: Permission.Maintenance, admin: true })
async startMaintenance(@Auth() auth: AuthDto, @Res({ passthrough: true }) response: Response): Promise<void> {
const { secret } = await this.service.startMaintenance();
const jwt = await this.service.createJwt(secret, {
username: auth.user.name,
});
const { jwt } = await this.service.startMaintenance(auth);
response.cookie(ImmichCookie.MaintenanceToken, jwt);
}