Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dom-murray committed Nov 8, 2023
1 parent c563ab3 commit c818506
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#include "Immutable/Misc/ImtblLogging.h"

UImtblPassportGetAccessTokenAsyncAction *
UImtblPassportGetAccessTokenAsyncAction::GetAccessToken(UObject *WorldContextObject) {
UImtblPassportGetAccessTokenAsyncAction::GetAccessToken(
UObject *WorldContextObject) {
UImtblPassportGetAccessTokenAsyncAction *PassportInitBlueprintNode =
NewObject<UImtblPassportGetAccessTokenAsyncAction>();
PassportInitBlueprintNode->WorldContextObject = WorldContextObject;
Expand All @@ -23,8 +24,8 @@ void UImtblPassportGetAccessTokenAsyncAction::Activate() {
return;
}

GetSubsystem()->WhenReady(this,
&UImtblPassportGetAccessTokenAsyncAction::DoGetAccessToken);
GetSubsystem()->WhenReady(
this, &UImtblPassportGetAccessTokenAsyncAction::DoGetAccessToken);
}

void UImtblPassportGetAccessTokenAsyncAction::DoGetAccessToken(
Expand All @@ -34,7 +35,8 @@ void UImtblPassportGetAccessTokenAsyncAction::DoGetAccessToken(
// Run GetAccessToken
Passport->GetAccessToken(
UImmutablePassport::FImtblPassportResponseDelegate::CreateUObject(
this, &UImtblPassportGetAccessTokenAsyncAction::OnGetAccessTokenResponse));
this,
&UImtblPassportGetAccessTokenAsyncAction::OnGetAccessTokenResponse));
}

void UImtblPassportGetAccessTokenAsyncAction::OnGetAccessTokenResponse(
Expand Down
52 changes: 26 additions & 26 deletions Source/Immutable/Private/Immutable/ImmutablePassport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ void UImmutablePassport::GetIdToken(
}

void UImmutablePassport::GetAccessToken(
const FImtblPassportResponseDelegate &ResponseDelegate) {
CallJS(ImmutablePassportAction::CheckStoredCredentials, TEXT(""),
ResponseDelegate,
FImtblJSResponseDelegate::CreateUObject(
this, &UImmutablePassport::OnGetAccessTokenResponse));
const FImtblPassportResponseDelegate &ResponseDelegate) {
CallJS(ImmutablePassportAction::CheckStoredCredentials, TEXT(""),
ResponseDelegate,
FImtblJSResponseDelegate::CreateUObject(
this, &UImmutablePassport::OnGetAccessTokenResponse));
}

void UImmutablePassport::GetAddress(
Expand Down Expand Up @@ -592,26 +592,26 @@ void UImmutablePassport::OnGetIdTokenResponse(FImtblJSResponse Response) {
}

void UImmutablePassport::OnGetAccessTokenResponse(FImtblJSResponse Response) {
if (auto ResponseDelegate = GetResponseDelegate(Response)) {
// Extract the credentials
auto Credentials =
JsonObjectToUStruct<FImmutablePassportTokenData>(Response.JsonObject);

if (!Response.success || !Credentials.IsSet() ||
!Credentials->accessToken.Len()) {
IMTBL_LOG("No stored credentials found.");
FString Msg;
Response.Error.IsSet()
? Msg = Response.Error->ToString()
: Msg = Response.JsonObject->GetStringField(TEXT("error"));
ResponseDelegate->ExecuteIfBound(
FImmutablePassportResult{false, Msg, Response});
} else {
IMTBL_LOG("Stored access token found.");
ResponseDelegate->ExecuteIfBound(
FImmutablePassportResult{true, Credentials->accessToken});
}
}
if (auto ResponseDelegate = GetResponseDelegate(Response)) {
// Extract the credentials
auto Credentials =
JsonObjectToUStruct<FImmutablePassportTokenData>(Response.JsonObject);

if (!Response.success || !Credentials.IsSet() ||
!Credentials->accessToken.Len()) {
IMTBL_LOG("No stored credentials found.");
FString Msg;
Response.Error.IsSet()
? Msg = Response.Error->ToString()
: Msg = Response.JsonObject->GetStringField(TEXT("error"));
ResponseDelegate->ExecuteIfBound(
FImmutablePassportResult{false, Msg, Response});
} else {
IMTBL_LOG("Stored access token found.");
ResponseDelegate->ExecuteIfBound(
FImmutablePassportResult{true, Credentials->accessToken});
}
}
}

void UImmutablePassport::OnGetAddressResponse(FImtblJSResponse Response) {
Expand Down Expand Up @@ -921,4 +921,4 @@ void UImmutablePassport::CallJniStaticVoidMethod(JNIEnv *Env,
// {
// OnPassportReady.Add(Delegate);
// }
// }
// }

0 comments on commit c818506

Please sign in to comment.