Skip to content

Commit c7ddb31

Browse files
chore: add pkce support for windows 2
1 parent d56d7d1 commit c7ddb31

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

Source/Immutable/Private/Immutable/ImmutablePassport.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void UImmutablePassport::ConnectPKCE(bool IsConnectImx, const FImtblPassportResp
132132

133133
void UImmutablePassport::Logout(bool DoHardLogout, const FImtblPassportResponseDelegate& ResponseDelegate)
134134
{
135-
#if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC | PLATFORM_WINDOWS
135+
#if PLATFORM_WINDOWS
136136
// Verify PKCEData is null before initializing to ensure we're not overriding an active PKCE operation.
137137
// A non-null value indicates another PKCE operation is already in progress.
138138
ensureAlways(!PKCEData);
@@ -141,7 +141,8 @@ void UImmutablePassport::Logout(bool DoHardLogout, const FImtblPassportResponseD
141141
{
142142
PKCEData->DynamicMulticastDelegate_DeepLinkCallback.AddDynamic(this, &ThisClass::OnDeepLinkActivated);
143143
}
144-
144+
#endif
145+
#if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC | PLATFORM_WINDOWS
145146
if (IsStateFlagsSet(IPS_PKCE))
146147
{
147148
PKCELogoutResponseDelegate = ResponseDelegate;
@@ -787,17 +788,14 @@ void UImmutablePassport::CompleteLoginPKCEFlow(FString Url)
787788
}
788789
#endif
789790

790-
#if PLATFORM_ANDROID
791+
#if PLATFORM_ANDROID | PLATFORM_WINDOWS
791792
// Called from Android JNI
792793
void UImmutablePassport::HandleDeepLink(FString DeepLink) const
793794
#endif
794795
#if PLATFORM_IOS | PLATFORM_MAC
795796
// Called from iOS Objective C
796797
void UImmutablePassport::HandleDeepLink(NSString* sDeepLink) const
797798
#endif
798-
#if PLATFORM_WINDOWS
799-
void UImmutablePassport::HandleDeepLink(FString DeepLink) const
800-
#endif
801799
{
802800
#if PLATFORM_IOS | PLATFORM_MAC
803801
FString DeepLink = FString(UTF8_TO_TCHAR([sDeepLink UTF8String]));

Source/Immutable/Public/Immutable/ImmutablePassport.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class IMMUTABLE_API UImmutablePassport : public UObject
189189
* FImtblPassportResponseDelegate to call on response from JS.
190190
*/
191191
void ZkEvmSignTypedDataV4(const FString& RequestJsonString, const FImtblPassportResponseDelegate& ResponseDelegate);
192-
192+
193193
/**
194194
* Gets the currently saved ID token without verifying its validity.
195195
*
@@ -293,14 +293,22 @@ class IMMUTABLE_API UImmutablePassport : public UObject
293293
*/
294294
static TArray<FString> GetResponseResultAsStringArray(const FImtblJSResponse& Response);
295295

296-
#if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC | PLATFORM_WINDOWS
296+
#if PLATFORM_ANDROID | PLATFORM_WINDOWS
297297
/**
298298
* Handle deep linking. This is called from platform-specific code.
299299
*
300300
* @param DeepLink The deep link URL to process.
301301
*/
302302
void HandleDeepLink(FString DeepLink) const;
303303
#endif
304+
#if PLATFORM_IOS | PLATFORM_MAC
305+
/**
306+
* Handle deep linking. This is called from iOS/Mac native code.
307+
*
308+
* @param DeepLink The deep link URL, passed from the iOS/Mac. This string contains the deep link data to be processed.
309+
*/
310+
void HandleDeepLink(NSString* sDeepLink) const;
311+
#endif
304312

305313
#if PLATFORM_ANDROID
306314
/**
@@ -545,7 +553,7 @@ class IMMUTABLE_API UImmutablePassport : public UObject
545553
* PKCE data used for PKCE operations e.g. login and logout flows.
546554
* When null, no PKCE operation is currently in progress.
547555
* When non-null, an active PKCE operation is being processed.
548-
*/
556+
*/
549557
UPROPERTY(Transient)
550558
TObjectPtr<UImmutablePKCEData> PKCEData;
551559
};

0 commit comments

Comments
 (0)