mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 15:44:45 -04:00
fix(auth-service): typeorm query in getTokensbyUser
TypeORM does not support WHERE queries for relation-colums directly. This replaces the Equal() constructor with a manual comparison of the IDs. See https://github.com/typeorm/typeorm/issues/2707 Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
e52cf4b4ae
commit
921cffb76f
1 changed files with 3 additions and 4 deletions
|
@ -160,10 +160,9 @@ export class AuthService {
|
|||
}
|
||||
|
||||
async getTokensByUser(user: User): Promise<AuthToken[]> {
|
||||
const tokens = await this.authTokenRepository
|
||||
.createQueryBuilder('token')
|
||||
.where('token.userId = :userId', { userId: user.id })
|
||||
.getMany();
|
||||
const tokens = await this.authTokenRepository.find({
|
||||
where: { user: { id: user.id } },
|
||||
});
|
||||
if (tokens === null) {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue