From a364054db60e1a91c5fb671616783b1db9deb590 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Mon, 18 Aug 2014 04:31:46 +0200 Subject: [PATCH] Minor fixes Signed-off-by: Rohit Yadav --- .../src/com/cloud/api/auth/SAML2LoginAPIAuthenticatorCmd.java | 2 +- ui/scripts/cloudStack.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/auth/SAML2LoginAPIAuthenticatorCmd.java b/server/src/com/cloud/api/auth/SAML2LoginAPIAuthenticatorCmd.java index 1f88c1cbce1..ce97cfd71d3 100644 --- a/server/src/com/cloud/api/auth/SAML2LoginAPIAuthenticatorCmd.java +++ b/server/src/com/cloud/api/auth/SAML2LoginAPIAuthenticatorCmd.java @@ -325,7 +325,7 @@ public class SAML2LoginAPIAuthenticatorCmd extends BaseCmd implements APIAuthent resp.addCookie(new Cookie("sessionKey", URLEncoder.encode(loginResponse.getSessionKey(), HttpUtils.UTF_8))); resp.addCookie(new Cookie("account", URLEncoder.encode(loginResponse.getAccount(), HttpUtils.UTF_8))); resp.addCookie(new Cookie("timezone", URLEncoder.encode(loginResponse.getTimeZone(), HttpUtils.UTF_8))); - resp.addCookie(new Cookie("userfullname", URLEncoder.encode(loginResponse.getFirstName() + " " + loginResponse.getLastName(), HttpUtils.UTF_8))); + resp.addCookie(new Cookie("userfullname", loginResponse.getFirstName() + "%20" + loginResponse.getLastName())); resp.sendRedirect("http://localhost:8080/client"); return ApiResponseSerializer.toSerializedString(loginResponse, responseType); diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 420c1373694..edc7c21529c 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -132,7 +132,7 @@ g_mySession = $.cookie('JSESSIONID'); g_sessionKey = $.cookie('sessionKey'); // Unbox quotes from sessionKey cookie value - if (g_sessionKey[0] === '"' && g_sessionKey[g_sessionKey.length-1] === '"') { + if (g_sessionKey && g_sessionKey[0] === '"' && g_sessionKey[g_sessionKey.length-1] === '"') { g_sessionKey = g_sessionKey.slice(1, g_sessionKey.length-1); $.cookie('sessionKey', g_sessionKey, { expires: 1