Skip to content

Commit

Permalink
feat: allow logout redirect uri to be set for device code auth
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Sep 6, 2024
1 parent 1aa32d2 commit 8f35367
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sample/Assets/Scripts/SelectAuthMethodScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private bool IsPKCESupported()
public void UseDeviceCodeAuth()
{
SampleAppManager.UsePKCE = false;
InitialisePassport();
InitialisePassport(logoutRedirectUri: "https://www.immutable.com");
}

/// <summary>
Expand All @@ -61,7 +61,7 @@ public void UsePKCE()
/// </summary>
/// <param name="redirectUri">(Android, iOS and macOS only) The URL to which auth will redirect the browser after
/// authorisation has been granted by the user</param>
/// <param name="logoutRedirectUri">(Android, iOS and macOS only) The URL to which auth will redirect the browser
/// <param name="logoutRedirectUri">The URL to which auth will redirect the browser
/// after log out is complete</param>
private async void InitialisePassport(string redirectUri = null, string logoutRedirectUri = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ internal class InitRequest
{
public string clientId;
public string environment;
public string logoutRedirectUri;
public VersionInfo engineVersion;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public async UniTask Init(string clientId, string environment, string redirectUr
};

string initRequest;
if (redirectUri != null && logoutRedirectUri != null)
if (redirectUri != null)
{
InitRequestWithRedirectUri requestWithRedirectUri = new InitRequestWithRedirectUri()
{
Expand All @@ -89,6 +89,7 @@ public async UniTask Init(string clientId, string environment, string redirectUr
{
clientId = clientId,
environment = environment,
logoutRedirectUri = logoutRedirectUri,
engineVersion = versionInfo
};
initRequest = JsonUtility.ToJson(request);
Expand Down

0 comments on commit 8f35367

Please sign in to comment.