From 8fff5db7580960bc9d04724b533dc211106b1c44 Mon Sep 17 00:00:00 2001 From: gconsidine Date: Mon, 25 Sep 2017 11:45:52 -0400 Subject: [PATCH] Add quotes to auth token when stored as a cookie --- .../authenticationServices/authentication.service.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/login/authenticationServices/authentication.service.js b/awx/ui/client/src/login/authenticationServices/authentication.service.js index f7c6f565a0..f1c951ea53 100644 --- a/awx/ui/client/src/login/authenticationServices/authentication.service.js +++ b/awx/ui/client/src/login/authenticationServices/authentication.service.js @@ -25,7 +25,13 @@ export default $cookies.remove('token'); $cookies.remove('token_expires'); $cookies.remove('userLoggedIn'); - $cookies.put('token', token); + + if (token && !(/^"[a-f0-9]+"$/ig.test(token))) { + $cookies.put('token', `"${token}"`); + } else { + $cookies.put('token', token); + } + $cookies.put('token_expires', expires); $cookies.put('userLoggedIn', true); $cookies.put('sessionExpired', false);