From d312082d45d99b8dd119e5ad2c4448c982e6b1ea Mon Sep 17 00:00:00 2001 From: Arne Gnisa Date: Wed, 11 Oct 2023 15:01:37 +0200 Subject: [PATCH] N21-1273 test fix --- .../modules/authentication/strategy/oauth2.strategy.spec.ts | 4 ++-- .../src/modules/authentication/strategy/oauth2.strategy.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts b/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts index 07f98b9b98f..722ba125574 100644 --- a/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts +++ b/apps/server/src/modules/authentication/strategy/oauth2.strategy.spec.ts @@ -9,7 +9,7 @@ import { AccountDto } from '@src/modules/account/services/dto'; import { OAuthTokenDto } from '@src/modules/oauth'; import { OAuthService } from '@src/modules/oauth/service/oauth.service'; import { SchoolInMigrationError } from '../errors/school-in-migration.error'; -import { ICurrentUser } from '../interface'; +import { ICurrentUser, OauthCurrentUser } from '../interface'; import { Oauth2Strategy } from './oauth2.strategy'; describe('Oauth2Strategy', () => { @@ -81,7 +81,7 @@ describe('Oauth2Strategy', () => { body: { code: 'code', redirectUri: 'redirectUri', systemId }, }); - expect(result).toEqual({ + expect(result).toEqual({ systemId, userId: user.id as EntityId, roles: [user.roles[0].id], diff --git a/apps/server/src/modules/authentication/strategy/oauth2.strategy.ts b/apps/server/src/modules/authentication/strategy/oauth2.strategy.ts index dd4ae61682a..6d532538e68 100644 --- a/apps/server/src/modules/authentication/strategy/oauth2.strategy.ts +++ b/apps/server/src/modules/authentication/strategy/oauth2.strategy.ts @@ -8,7 +8,7 @@ import { OAuthService } from '@src/modules/oauth/service/oauth.service'; import { Strategy } from 'passport-custom'; import { Oauth2AuthorizationBodyParams } from '../controllers/dto'; import { SchoolInMigrationError } from '../errors/school-in-migration.error'; -import { ICurrentUser } from '../interface'; +import { ICurrentUser, OauthCurrentUser } from '../interface'; import { CurrentUserMapper } from '../mapper'; @Injectable() @@ -37,7 +37,7 @@ export class Oauth2Strategy extends PassportStrategy(Strategy, 'oauth2') { throw new UnauthorizedException('no account found'); } - const currentUser: ICurrentUser = CurrentUserMapper.mapToOauthCurrentUser( + const currentUser: OauthCurrentUser = CurrentUserMapper.mapToOauthCurrentUser( account.id, user, systemId,