refactor: User and session management

This commit is contained in:
Aleksi Lassila
2024-06-12 18:32:39 +03:00
parent a73f9d6cca
commit 5c1a4d4206
28 changed files with 364 additions and 388 deletions

View File

@@ -19,6 +19,7 @@ export class AuthService {
password: string,
): Promise<{
token: string;
user: User;
}> {
let user = await this.userService.findOneByName(name);
if (!user && (await this.userService.noPreviousAdmins()))
@@ -34,6 +35,7 @@ export class AuthService {
return {
token: await this.jwtService.signAsync(payload),
user,
};
}
}