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);