From 8f379b6be57ad609946af439abca0e74a64e7acd Mon Sep 17 00:00:00 2001 From: Konstantinos Kopanidis Date: Thu, 11 Jan 2024 22:03:10 +0200 Subject: [PATCH] fix(authentication): apple strategy using provider instead of conduit client id fix(authentication): native login using wrong clientid --- modules/authentication/src/handlers/oauth2/OAuth2.ts | 2 +- modules/authentication/src/handlers/oauth2/apple/apple.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/authentication/src/handlers/oauth2/OAuth2.ts b/modules/authentication/src/handlers/oauth2/OAuth2.ts index 7055819d5..3b9ebb8d0 100644 --- a/modules/authentication/src/handlers/oauth2/OAuth2.ts +++ b/modules/authentication/src/handlers/oauth2/OAuth2.ts @@ -191,7 +191,7 @@ export abstract class OAuth2 return TokenProvider.getInstance().provideUserTokens({ user, - clientId: this.settings.clientId, + clientId: call.request.context.clientId, config, }); } diff --git a/modules/authentication/src/handlers/oauth2/apple/apple.ts b/modules/authentication/src/handlers/oauth2/apple/apple.ts index e6366fb46..0c91ed03f 100644 --- a/modules/authentication/src/handlers/oauth2/apple/apple.ts +++ b/modules/authentication/src/handlers/oauth2/apple/apple.ts @@ -27,7 +27,6 @@ import { ConfigController, RoutingManager, } from '@conduitplatform/module-tools'; -import { isNil } from 'lodash'; import { AuthUtils } from '../../../utils'; export class AppleHandlers extends OAuth2 { @@ -139,10 +138,12 @@ export class AppleHandlers extends OAuth2 { const redirectUri = AuthUtils.validateRedirectUri(stateToken.data.customRedirectUri) ?? this.settings.finalRedirect; + const conduitClientId = stateToken.data.clientId; + return TokenProvider.getInstance()!.provideUserTokens( { user, - clientId, + clientId: conduitClientId, config, }, redirectUri,