From c5af33e99aa5305738fa05aa600db37bf5fe17e2 Mon Sep 17 00:00:00 2001 From: Arne Gnisa Date: Wed, 1 Nov 2023 11:35:04 +0100 Subject: [PATCH] N21-1219 adds adjustments --- .../mapper/current-user.mapper.spec.ts | 21 ------------------- apps/server/src/modules/oauth/uc/oauth.uc.ts | 3 --- .../src/modules/user/service/user.service.ts | 13 ++++++------ .../uc/video-conference-deprecated.uc.spec.ts | 1 - 4 files changed, 6 insertions(+), 32 deletions(-) diff --git a/apps/server/src/modules/authentication/mapper/current-user.mapper.spec.ts b/apps/server/src/modules/authentication/mapper/current-user.mapper.spec.ts index cf76a0da1d4..c0f833ad48f 100644 --- a/apps/server/src/modules/authentication/mapper/current-user.mapper.spec.ts +++ b/apps/server/src/modules/authentication/mapper/current-user.mapper.spec.ts @@ -219,16 +219,6 @@ describe('CurrentUserMapper', () => { impersonated: jwtPayload.support, }); }); - - /* it('should return current user with default for isExternalUser', () => { - const { jwtPayload } = setup(); - - const currentUser = CurrentUserMapper.jwtToICurrentUser(jwtPayload); - - expect(currentUser).toMatchObject({ - isExternalUser: jwtPayload.isExternalUser, - }); - }); */ }); describe('when JWT is provided without optional claims', () => { @@ -238,7 +228,6 @@ describe('CurrentUserMapper', () => { roles: ['mockRoleId'], schoolId: 'dummySchoolId', userId: 'dummyUserId', - // isExternalUser: false, sub: 'dummyAccountId', jti: 'random string', aud: 'some audience', @@ -264,16 +253,6 @@ describe('CurrentUserMapper', () => { userId: jwtPayload.userId, }); }); - - /* it('should return current user with default for isExternalUser', () => { - const { jwtPayload } = setup(); - - const currentUser = CurrentUserMapper.jwtToICurrentUser(jwtPayload); - - expect(currentUser).toMatchObject({ - isExternalUser: false, - }); - }); */ }); }); diff --git a/apps/server/src/modules/oauth/uc/oauth.uc.ts b/apps/server/src/modules/oauth/uc/oauth.uc.ts index f3540879953..e7004142daa 100644 --- a/apps/server/src/modules/oauth/uc/oauth.uc.ts +++ b/apps/server/src/modules/oauth/uc/oauth.uc.ts @@ -63,9 +63,6 @@ export class OauthUc { return authenticationUrl; } - /** - * @deprecated Please use the oauth2 strategy instead. - */ async processOAuthLogin(cachedState: OauthLoginStateDto, code?: string, error?: string): Promise { const { state, systemId, postLoginRedirect, userLoginMigration } = cachedState; diff --git a/apps/server/src/modules/user/service/user.service.ts b/apps/server/src/modules/user/service/user.service.ts index e8b9f4e7fb9..2cc95991f96 100644 --- a/apps/server/src/modules/user/service/user.service.ts +++ b/apps/server/src/modules/user/service/user.service.ts @@ -1,17 +1,16 @@ -import { ConfigService } from '@nestjs/config'; -import { EntityId, IFindOptions, LanguageType, User } from '@shared/domain'; -import { RoleReference, Page, UserDO } from '@shared/domain/domainobject'; -import { UserRepo } from '@shared/repo'; -import { UserDORepo } from '@shared/repo/user/user-do.repo'; import { AccountService } from '@modules/account'; import { AccountDto } from '@modules/account/services/dto'; -import { ICurrentUser } from '@modules/authentication'; // invalid import import { CurrentUserMapper } from '@modules/authentication/mapper'; import { RoleDto } from '@modules/role/service/dto/role.dto'; import { RoleService } from '@modules/role/service/role.service'; import { BadRequestException, Injectable } from '@nestjs/common'; -import { OauthCurrentUser } from '../../authentication/interface'; +import { ConfigService } from '@nestjs/config'; +import { EntityId, IFindOptions, LanguageType, User } from '@shared/domain'; +import { Page, RoleReference, UserDO } from '@shared/domain/domainobject'; +import { UserRepo } from '@shared/repo'; +import { UserDORepo } from '@shared/repo/user/user-do.repo'; +import { OauthCurrentUser } from '@modules/authentication/interface'; import { IUserConfig } from '../interfaces'; import { UserMapper } from '../mapper/user.mapper'; import { UserDto } from '../uc/dto/user.dto'; diff --git a/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts b/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts index 994c8042a6d..4d15397548b 100644 --- a/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts +++ b/apps/server/src/modules/video-conference/uc/video-conference-deprecated.uc.spec.ts @@ -172,7 +172,6 @@ describe('VideoConferenceUc', () => { roles: [], schoolId: 'schoolId', accountId: 'accountId', - isExternalUser: false, }; defaultOptions = { everybodyJoinsAsModerator: false,