Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add silent logout to passport init blueprint #131

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "Immutable/ImmutableSubsystem.h"


UImtblPassportInitializationAsyncAction* UImtblPassportInitializationAsyncAction::InitializePassport(UObject* WorldContextObject, const FString& ClientID, const FString& RedirectUri, const FString& LogoutUri, const FString& Environment)
UImtblPassportInitializationAsyncAction* UImtblPassportInitializationAsyncAction::InitializePassport(UObject* WorldContextObject, const FString& ClientID, const FString& RedirectUri, const FString& LogoutUri, const FString& Environment, bool IsSilentLogout)
{
UImtblPassportInitializationAsyncAction* PassportInitBlueprintNode = NewObject<UImtblPassportInitializationAsyncAction>();

Expand All @@ -15,6 +15,7 @@ UImtblPassportInitializationAsyncAction* UImtblPassportInitializationAsyncAction
PassportInitBlueprintNode->LogoutUri = LogoutUri;
PassportInitBlueprintNode->Environment = Environment;
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
PassportInitBlueprintNode->IsSilentLogout = IsSilentLogout;

return PassportInitBlueprintNode;
}
Expand All @@ -35,7 +36,7 @@ void UImtblPassportInitializationAsyncAction::DoInit(TWeakObjectPtr<UImtblJSConn
// Get Passport
auto Passport = GetSubsystem()->GetPassport();
// Run Initialize
Passport->Initialize(FImmutablePassportInitData{ClientId, RedirectUri, LogoutUri, Environment}, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportInitializationAsyncAction::OnInitialized));
Passport->Initialize(FImmutablePassportInitData{ClientId, RedirectUri, LogoutUri, Environment, IsSilentLogout}, UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(this, &UImtblPassportInitializationAsyncAction::OnInitialized));
}

void UImtblPassportInitializationAsyncAction::OnInitialized(FImmutablePassportResult Result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class IMMUTABLE_API UImtblPassportInitializationAsyncAction : public UImtblBluep

public:
UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject", BlueprintInternalUseOnly = "true"), Category = "Immutable")
static UImtblPassportInitializationAsyncAction* InitializePassport(UObject* WorldContextObject, const FString& ClientID, const FString& RedirectUri, const FString& LogoutUri, const FString& Environment);
static UImtblPassportInitializationAsyncAction* InitializePassport(UObject* WorldContextObject, const FString& ClientID, const FString& RedirectUri, const FString& LogoutUri, const FString& Environment, bool IsSilentLogout);

virtual void Activate() override;

Expand All @@ -29,6 +29,7 @@ class IMMUTABLE_API UImtblPassportInitializationAsyncAction : public UImtblBluep
FString RedirectUri;
FString LogoutUri;
FString Environment;
bool IsSilentLogout;

UPROPERTY(BlueprintAssignable)
FPassportInitializationOutputPin Initialized;
Expand Down
3 changes: 3 additions & 0 deletions Source/Immutable/Public/Immutable/ImmutableDataTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ struct IMMUTABLE_API FImmutablePassportInitData
UPROPERTY()
FString environment = ImmutablePassportAction::EnvSandbox;

UPROPERTY()
bool isSilentLogout = false;

UPROPERTY()
FImmutableEngineVersionData engineVersion;

Expand Down
Loading