parent
e4cb8eba1d
commit
2d603a1467
@ -28,7 +28,7 @@ export class CreateAuth {
|
|||||||
if (!this.password) {
|
if (!this.password) {
|
||||||
throw new PasswordNeededError()
|
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) {
|
if (found_users.length === 0) {
|
||||||
throw new UserNotFoundError()
|
throw new UserNotFoundError()
|
||||||
} else {
|
} else {
|
||||||
|
@ -21,7 +21,7 @@ export class RefreshAuth {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new IllegalJWTError()
|
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) {
|
if (!found_user) {
|
||||||
throw new UserNotFoundError()
|
throw new UserNotFoundError()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user