Skip to content

Commit

Permalink
[server] fix wrong order of tokens to select from
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Feb 8, 2022
1 parent ac0afcf commit a4d6edf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/gitpod-db/src/typeorm/user-db-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class TypeORMUserDBImpl implements UserDB {
if (tokenEntries.length === 0) {
return undefined;
}
return tokenEntries.sort((a, b) => `${a.token.updateDate}`.localeCompare(`${b.token.updateDate}`))[0]?.token;
return tokenEntries.sort((a, b) => `${a.token.updateDate}`.localeCompare(`${b.token.updateDate}`)).reverse()[0]?.token;
}

public async findTokensForIdentity(identity: Identity, includeDeleted?: boolean): Promise<TokenEntry[]> {
Expand Down

0 comments on commit a4d6edf

Please sign in to comment.