diff --git a/Source/Immutable/Private/Immutable/ImmutablePassport.cpp b/Source/Immutable/Private/Immutable/ImmutablePassport.cpp index 0d9837e..6a7ac24 100644 --- a/Source/Immutable/Private/Immutable/ImmutablePassport.cpp +++ b/Source/Immutable/Private/Immutable/ImmutablePassport.cpp @@ -1090,11 +1090,17 @@ void UImmutablePassport::HandleOnLoginPKCEDismissed() // User hasn't entered all required details (e.g. email address) into // Passport yet IMTBL_LOG("Login PKCE dismissed before completing the flow"); - if (!PKCEResponseDelegate.ExecuteIfBound(FImmutablePassportResult{ false, "Cancelled" })) + if (FTaskGraphInterface::IsRunning()) { - IMTBL_WARN("Login PKCEResponseDelegate delegate was not called"); + FGraphEventRef GameThreadTask = FFunctionGraphTask::CreateAndDispatchWhenReady([this]() + { + if (!PKCEResponseDelegate.ExecuteIfBound(FImmutablePassportResult{ false, "Cancelled" })) + { + IMTBL_WARN("Login PKCEResponseDelegate delegate was not called"); + } + PKCEResponseDelegate = nullptr; + }, TStatId(), nullptr, ENamedThreads::GameThread); } - PKCEResponseDelegate = nullptr; } else {