Skip to content

Commit

Permalink
chore: pkce for webgl only
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-yangy committed Oct 11, 2024
1 parent c0ad3cd commit 61d7735
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: (.*src/Packages/Passport/Runtime/ThirdParty/.*|.*src/Packages/Passport/Runtime/Resources/.*|.*Plugins/.*|.*src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/.*|.*src/Packages/Orderbook|.*sample|.*src/Packages/Passport/WebGLTemplates)
FILTER_REGEX_EXCLUDE: (.*src/Packages/Passport/Runtime/ThirdParty/.*|.*src/Packages/Passport/Runtime/Resources/.*|.*Plugins/.*|.*src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/.*|.*src/Packages/Orderbook|.*sample|.*src/Packages/Passport/WebGLTemplates~)
VALIDATE_MARKDOWN: false
VALIDATE_GITLEAKS: false
VALIDATE_JSCPD: false
Expand Down
7 changes: 6 additions & 1 deletion sample/Assets/Scripts/SelectAuthMethodScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ public class SelectAuthMethodScript : MonoBehaviour

void Start()
{
// WebGL does not support Device Code Auth, so we'll use PKCE by default instead.
#if UNITY_WEBGL
UsePKCE();
#else
// Determine if PKCE is supported based on the platform
SampleAppManager.SupportsPKCE = IsPKCESupported();

// If PKCE is not supported, initialise Passport to use Device Code Auth
if (!SampleAppManager.SupportsPKCE)
{
InitialisePassport(logoutRedirectUri: "https://www.immutable.com");
UseDeviceCodeAuth();
}
#endif
}

/// <summary>
Expand Down

0 comments on commit 61d7735

Please sign in to comment.