From b28efce4ea0b68fb7ecc508065c9674dc98ef203 Mon Sep 17 00:00:00 2001 From: Mikael Lirbank Date: Mon, 22 Aug 2016 14:46:50 -0700 Subject: [PATCH] fix: setAuthFromQueryParams checks for window var (#770) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix, setAuthFromQueryParams() compatible with React Native (android) `window` exists on Android but does not have a `location` property, so it’s necessary to check that `window.location` is not null. * TMP fix for client to work in React Native (breaks the CLI) * Revert "TMP fix for client to work in React Native (breaks the CLI)" This reverts commit 8b62b2d115efcfab185d69ef2fde5c8672537d76. --- client/src/auth.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/auth.js b/client/src/auth.js index 2a7dcd5a6..4b7bd8b7a 100644 --- a/client/src/auth.js +++ b/client/src/auth.js @@ -102,7 +102,8 @@ export class TokenStorage { } setAuthFromQueryParams() { - const parsed = typeof window !== 'undefined' ? + const parsed = typeof window !== 'undefined' && + typeof window.location !== 'undefined' ? queryParse(window.location.search) : {} if (parsed.horizon_token != null) {