mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
change getTokensByUsername to getTokensByUser
Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
parent
2ab3d7e8f9
commit
be27686610
3 changed files with 12 additions and 14 deletions
|
@ -40,8 +40,8 @@ export class TokensController {
|
|||
|
||||
@Get()
|
||||
async getUserTokens(@RequestUser() user: User): Promise<AuthTokenDto[]> {
|
||||
return (await this.authService.getTokensByUsername(user.userName)).map(
|
||||
(token) => this.authService.toAuthTokenDto(token),
|
||||
return (await this.authService.getTokensByUser(user)).map((token) =>
|
||||
this.authService.toAuthTokenDto(token),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ export class TokensController {
|
|||
@RequestUser() user: User,
|
||||
@Param('keyId') keyId: string,
|
||||
): Promise<void> {
|
||||
const tokens = await this.authService.getTokensByUsername(user.userName);
|
||||
const tokens = await this.authService.getTokensByUser(user);
|
||||
try {
|
||||
for (const token of tokens) {
|
||||
if (token.keyId == keyId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue