|
|
@@ -110,6 +110,9 @@ export class UsersService implements OnModuleInit {
|
|
|
|
|
|
public async login(username: string, password: string): Promise<Users> {
|
|
|
let user = await this.userRepository.findOneBy({ username })
|
|
|
+ if (user.roles.includes(Role.Admin)) {
|
|
|
+ throw new UnauthorizedException('Please login again')
|
|
|
+ }
|
|
|
if (!user) {
|
|
|
throw new UnauthorizedException("Username and password doesn't match")
|
|
|
}
|