parent
e4cb8eba1d
commit
2d603a1467
|
@ -28,7 +28,7 @@ export class CreateAuth {
|
|||
if (!this.password) {
|
||||
throw new PasswordNeededError()
|
||||
}
|
||||
const found_users = await getConnectionManager().get().getRepository(User).find({ where: [{ username: this.username }, { email: this.email }] });
|
||||
const found_users = await getConnectionManager().get().getRepository(User).find({ relations: ['groups', 'permissions'], where: [{ username: this.username }, { email: this.email }] });
|
||||
if (found_users.length === 0) {
|
||||
throw new UserNotFoundError()
|
||||
} else {
|
||||
|
|
|
@ -21,7 +21,7 @@ export class RefreshAuth {
|
|||
} catch (error) {
|
||||
throw new IllegalJWTError()
|
||||
}
|
||||
const found_user = await getConnectionManager().get().getRepository(User).findOne({ id: decoded["userid"] });
|
||||
const found_user = await getConnectionManager().get().getRepository(User).findOne({ id: decoded["userid"] }, { relations: ['groups', 'permissions'] });
|
||||
if (!found_user) {
|
||||
throw new UserNotFoundError()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue