mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
correct parameters for authenticateGmsUserPlayground
This commit is contained in:
parent
ad3ebefa3a
commit
0c3b0f7a53
@ -728,14 +728,18 @@ export class UserResolver {
|
||||
@Authorized([RIGHTS.GMS_USER_PLAYGROUND])
|
||||
@Query(() => GmsUserAuthenticationResult)
|
||||
async authenticateGmsUserSearch(@Ctx() context: Context): Promise<GmsUserAuthenticationResult> {
|
||||
logger.info(`authUserForGmsUserSearch()...`)
|
||||
logger.info(`authenticateGmsUserSearch()...`)
|
||||
const dbUser = getUser(context)
|
||||
let result: GmsUserAuthenticationResult
|
||||
let result = new GmsUserAuthenticationResult()
|
||||
if (context.token) {
|
||||
result = await authenticateGmsUserPlayground(context.token, dbUser)
|
||||
logger.info('authUserForGmsUserSearch=', result)
|
||||
const homeCom = await getHomeCommunity()
|
||||
if (!homeCom.gmsApiKey) {
|
||||
throw new LogError('authenticateGmsUserSearch missing HomeCommunity GmsApiKey')
|
||||
}
|
||||
result = await authenticateGmsUserPlayground(homeCom.gmsApiKey, context.token, dbUser)
|
||||
logger.info('authenticateGmsUserSearch=', result)
|
||||
} else {
|
||||
throw new LogError('authUserForGmsUserSearch without token')
|
||||
throw new LogError('authenticateGmsUserSearch missing valid user login-token')
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@ -7,13 +7,14 @@ import { backendLogger as logger } from '@/server/logger'
|
||||
import { ensureUrlEndsWithSlash } from '@/util/utilities'
|
||||
|
||||
export async function authenticateGmsUserPlayground(
|
||||
apiKey: string,
|
||||
token: string,
|
||||
dbUser: DbUser,
|
||||
): Promise<GmsUserAuthenticationResult> {
|
||||
const result = new GmsUserAuthenticationResult()
|
||||
const dashboardUrl = ensureUrlEndsWithSlash(CONFIG.GMS_DASHBOARD_URL)
|
||||
|
||||
result.url = dashboardUrl.concat('playground')
|
||||
result.url = dashboardUrl.concat('usersearch-playground')
|
||||
result.token = await verifyAuthToken(dbUser.communityUuid, token)
|
||||
logger.info('GmsUserAuthenticationResult:', result)
|
||||
return result
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user