From a1bad914d876bf3dd2aace4ebe7c1c25587f0bd0 Mon Sep 17 00:00:00 2001 From: Steven Williams Date: Thu, 1 Aug 2019 15:33:44 +1000 Subject: [PATCH] fix(@aws-amplify/auth): Encode customState when storing to compare against incoming state for federated sign in --- packages/auth/src/OAuth/OAuth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/auth/src/OAuth/OAuth.ts b/packages/auth/src/OAuth/OAuth.ts index fd83dfe0462..c5537f603ec 100644 --- a/packages/auth/src/OAuth/OAuth.ts +++ b/packages/auth/src/OAuth/OAuth.ts @@ -72,7 +72,7 @@ export default class OAuth { const generatedState = this._generateState(32); const state = customState ? `${generatedState}-${customState}` : generatedState; - oAuthStorage.setState(state); + oAuthStorage.setState(encodeURIComponent(state)); const pkce_key = this._generateRandom(128); oAuthStorage.setPKCE(pkce_key);