mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
rename graphql query to authenticateGmsUserSearch
This commit is contained in:
parent
104d174f18
commit
c5c6592964
@ -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)
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -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
|
||||
@ -15,6 +15,13 @@ export const verifyLogin = gql`
|
||||
}
|
||||
}
|
||||
`
|
||||
export const authenticateGmsUserSearch = gql`
|
||||
query {
|
||||
authenticateGmsUserSearch {
|
||||
gmsPlaygroundUri
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const queryOptIn = gql`
|
||||
query ($optIn: String!) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user