Skip to content

Instantly share code, notes, and snippets.

@chris-gong
Created May 17, 2020 17:33
Show Gist options
  • Save chris-gong/0da4b256a505f40e684a80316f6830d6 to your computer and use it in GitHub Desktop.
Save chris-gong/0da4b256a505f40e684a80316f6830d6 to your computer and use it in GitHub Desktop.
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "Runtime/Online/HTTP/Public/Http.h"
#include "GameLiftTutorialGameInstance.generated.h"
/**
*
*/
UCLASS()
class GAMELIFTTUTORIAL_API UGameLiftTutorialGameInstance : public UGameInstance
{
GENERATED_BODY()
public:
UGameLiftTutorialGameInstance();
virtual void Shutdown() override;
UPROPERTY()
FString AccessToken;
UPROPERTY()
FString IdToken;
UPROPERTY()
FString RefreshToken;
UPROPERTY()
FTimerHandle RetrieveNewTokensHandle;
UFUNCTION()
void SetCognitoTokens(FString NewAccessToken, FString NewIdToken, FString NewRefreshToken);
private:
FHttpModule* HttpModule;
UPROPERTY()
FString ApiUrl;
UFUNCTION()
void RetrieveNewTokens();
void OnRetrieveNewTokensResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment