feat: add sample endpoint to test JWT

This commit is contained in:
2026-01-03 04:37:20 +01:00
parent ec5cedce5a
commit c19a098b1c
8 changed files with 173 additions and 15 deletions

View File

@@ -75,6 +75,16 @@ export class UserService {
}
/**
* Finds a User by it's identifier.
*
* @param {number} id The identifier
* @return {(Promise<User|null>)} User (or null if not found)
*/
async findById(id: number): Promise<User | null> {
return await this.userRepo.findOneBy({id});
}
/**
* Counts all the user entities in DB.
* Used to tell whether the next created account should be an admin