diff --git a/backend/src/apis/gms/GmsClient.ts b/backend/src/apis/gms/GmsClient.ts index b1cdade2d..46cf38e54 100644 --- a/backend/src/apis/gms/GmsClient.ts +++ b/backend/src/apis/gms/GmsClient.ts @@ -200,12 +200,6 @@ export async function verifyAuthToken( // authorization: apiKey, }, } - /* - const data = { - uuid: communityUuid, - token: token, - } - */ try { const result = await axios.get(baseUrl.concat(service), config) logger.debug('GET-Response of verify-auth-token:', result) diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index a096fda44..44ae3e722 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -68,6 +68,7 @@ import random from 'random-bigint' import { randombytes_random } from 'sodium-native' import { FULL_CREATION_AVAILABLE } from './const/const' +import { authenticateGmsUserPlayground } from './util/authenticateGmsUserPlayground' import { getHomeCommunity } from './util/communities' import { compareGmsRelevantUserSettings } from './util/compareGmsRelevantUserSettings' import { getUserCreations } from './util/creations' @@ -78,7 +79,6 @@ import { Location2Point } from './util/Location2Point' import { setUserRole, deleteUserRole } from './util/modifyUserRole' import { sendUserToGms } from './util/sendUserToGms' import { validateAlias } from './util/validateAlias' -import { authenticateGmsUserSearch } from './util/authenticateGmsUserSearch' const LANGUAGES = ['de', 'en', 'es', 'fr', 'nl'] const DEFAULT_LANGUAGE = 'de' @@ -677,12 +677,12 @@ export class UserResolver { @Authorized([RIGHTS.GMS_USER_PLAYGROUND]) @Query(() => String) - async authUserForGmsUserSearch(@Ctx() context: Context): Promise { + async authenticateGmsUserSearch(@Ctx() context: Context): Promise { logger.info(`authUserForGmsUserSearch()...`) const dbUser = getUser(context) let gmsPlaygroundUri: string if (context.token) { - gmsPlaygroundUri = await authenticateGmsUserSearch(context.token, dbUser) + gmsPlaygroundUri = await authenticateGmsUserPlayground(context.token, dbUser) logger.debug('authUserForGmsUserSearch=', gmsPlaygroundUri) } else { throw new LogError('authUserForGmsUserSearch without token') diff --git a/backend/src/graphql/resolver/util/authenticateGmsUserSearch.ts b/backend/src/graphql/resolver/util/authenticateGmsUserPlayground.ts similarity index 67% rename from backend/src/graphql/resolver/util/authenticateGmsUserSearch.ts rename to backend/src/graphql/resolver/util/authenticateGmsUserPlayground.ts index 27bd98a91..5ad51ee42 100644 --- a/backend/src/graphql/resolver/util/authenticateGmsUserSearch.ts +++ b/backend/src/graphql/resolver/util/authenticateGmsUserPlayground.ts @@ -2,7 +2,7 @@ import { User as DbUser } from '@entity/User' import { verifyAuthToken } from '@/apis/gms/GmsClient' -export async function authenticateGmsUserSearch(token: string, dbUser: DbUser): Promise { +export async function authenticateGmsUserPlayground(token: string, dbUser: DbUser): Promise { const gmsPlaygroundUri = await verifyAuthToken(dbUser.communityUuid, token) return gmsPlaygroundUri diff --git a/backend/src/seeds/graphql/queries.ts b/backend/src/seeds/graphql/queries.ts index ed0fe6d26..904b097fc 100644 --- a/backend/src/seeds/graphql/queries.ts +++ b/backend/src/seeds/graphql/queries.ts @@ -15,6 +15,13 @@ export const verifyLogin = gql` } } ` +export const authenticateGmsUserSearch = gql` + query { + authenticateGmsUserSearch { + gmsPlaygroundUri + } + } +` export const queryOptIn = gql` query ($optIn: String!) {