addres users by their id

This commit is contained in:
rubikscraft
2022-04-01 13:18:05 +02:00
parent 9bcf09ff4f
commit 7c7e23696d
18 changed files with 99 additions and 90 deletions

View File

@@ -15,7 +15,6 @@ export class LocalAuthStrategy extends PassportStrategy(Strategy, 'local') {
username: string,
password: string,
): AsyncFailable<EUserBackend> {
// All this does is call the usersservice authenticate for authentication
const user = await this.usersService.authenticate(username, password);
if (HasFailed(user)) {

View File

@@ -50,7 +50,7 @@ export class MainAuthGuard extends AuthGuard(['jwt', 'guest']) {
}
// These are the permissions the user has
const userPermissions = await this.usersService.getPermissions(user);
const userPermissions = await this.usersService.getPermissions(user.id);
if (HasFailed(userPermissions)) {
this.logger.warn('User Permissions: ' + userPermissions.getReason());
throw new InternalServerErrorException();

View File

@@ -14,7 +14,7 @@ export class GuestService {
}
public async getGuestUser(): Promise<EUserBackend> {
const user = await this.usersService.findOne('guest');
const user = await this.usersService.findByUsername('guest');
if (HasFailed(user)) {
return this.fallBackUser;
}