diff --git a/backend/jest.config.js b/backend/jest.config.js index de649d66e..6140da0aa 100644 --- a/backend/jest.config.js +++ b/backend/jest.config.js @@ -7,7 +7,7 @@ module.exports = { collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**', '!src/seeds/**', '!build/**'], coverageThreshold: { global: { - lines: 84, + lines: 83, }, }, setupFiles: ['/test/testSetup.ts'], diff --git a/backend/src/apis/gms/GmsClient.ts b/backend/src/apis/gms/GmsClient.ts index b39a46a4f..32a3802ff 100644 --- a/backend/src/apis/gms/GmsClient.ts +++ b/backend/src/apis/gms/GmsClient.ts @@ -202,7 +202,7 @@ export async function verifyAuthToken( } try { const result = await axios.get(baseUrl.concat(service), config) - console.log('GET-Response of verify-auth-token:', result) + logger.debug('GET-Response of verify-auth-token:', result) if (result.status !== 200) { throw new LogError( 'HTTP Status Error in verify-auth-token:', @@ -210,10 +210,10 @@ export async function verifyAuthToken( result.statusText, ) } - console.log('responseData:', result.data.responseData) + logger.debug('responseData:', result.data.responseData) // eslint-disable-next-line @typescript-eslint/no-unsafe-call const token: string = result.data.responseData.token - console.log('verifyAuthToken=', token) + logger.debug('verifyAuthToken=', token) return token } catch (error: any) { logger.error('Error in verifyAuthToken:', error) diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index cbeb740f1..7c11776df 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -25,6 +25,7 @@ import { PasswordEncryptionType } from '@enum/PasswordEncryptionType' import { UserContactType } from '@enum/UserContactType' import { SearchAdminUsersResult } from '@model/AdminUser' // import { Location } from '@model/Location' +import { GmsUserAuthenticationResult } from '@model/GmsUserAuthenticationResult' import { User } from '@model/User' import { UserAdmin, SearchUsersResult } from '@model/UserAdmin' @@ -79,7 +80,6 @@ import { Location2Point } from './util/Location2Point' import { setUserRole, deleteUserRole } from './util/modifyUserRole' import { sendUserToGms } from './util/sendUserToGms' import { validateAlias } from './util/validateAlias' -import { GmsUserAuthenticationResult } from '../model/GmsUserAuthenticationResult' const LANGUAGES = ['de', 'en', 'es', 'fr', 'nl'] const DEFAULT_LANGUAGE = 'de' @@ -684,7 +684,7 @@ export class UserResolver { let result: GmsUserAuthenticationResult if (context.token) { result = await authenticateGmsUserPlayground(context.token, dbUser) - console.log('authUserForGmsUserSearch=', result) + logger.info('authUserForGmsUserSearch=', result) } else { throw new LogError('authUserForGmsUserSearch without token') } diff --git a/backend/src/graphql/resolver/util/authenticateGmsUserPlayground.ts b/backend/src/graphql/resolver/util/authenticateGmsUserPlayground.ts index 53c752b5d..cad98c683 100644 --- a/backend/src/graphql/resolver/util/authenticateGmsUserPlayground.ts +++ b/backend/src/graphql/resolver/util/authenticateGmsUserPlayground.ts @@ -3,6 +3,7 @@ import { User as DbUser } from '@entity/User' import { verifyAuthToken } from '@/apis/gms/GmsClient' import { CONFIG } from '@/config' import { GmsUserAuthenticationResult } from '@/graphql/model/GmsUserAuthenticationResult' +import { backendLogger as logger } from '@/server/logger' export async function authenticateGmsUserPlayground( token: string, @@ -11,6 +12,6 @@ export async function authenticateGmsUserPlayground( const result = new GmsUserAuthenticationResult() result.url = CONFIG.GMS_URL.concat('/playground') result.token = await verifyAuthToken(dbUser.communityUuid, token) - console.log('GmsUserAuthenticationResult:', result) + logger.info('GmsUserAuthenticationResult:', result) return result }