Skip to content

Commit

Permalink
Merge pull request #131 from immutable/feat/silent-logout
Browse files Browse the repository at this point in the history
feat: add silent logout to passport init blueprint
  • Loading branch information
CodeSchwert authored Sep 4, 2024
2 parents 076041b + fa02c86 commit 632f76d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
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

0 comments on commit 632f76d

Please sign in to comment.