rename graphql query to authenticateGmsUserSearch

This commit is contained in:
Claus-Peter Huebner 2024-03-21 22:33:05 +01:00
parent 104d174f18
commit c5c6592964
4 changed files with 11 additions and 10 deletions

View File

@ -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)

View File

@ -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<string> {
async authenticateGmsUserSearch(@Ctx() context: Context): Promise<string> {
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')

View File

@ -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<string> {
export async function authenticateGmsUserPlayground(token: string, dbUser: DbUser): Promise<string> {
const gmsPlaygroundUri = await verifyAuthToken(dbUser.communityUuid, token)
return gmsPlaygroundUri

View File

@ -15,6 +15,13 @@ export const verifyLogin = gql`
}
}
`
export const authenticateGmsUserSearch = gql`
query {
authenticateGmsUserSearch {
gmsPlaygroundUri
}
}
`
export const queryOptIn = gql`
query ($optIn: String!) {