summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerhome.cpp
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2009-12-15 23:45:38 +0000
committerLynx Linden <lynx@lindenlab.com>2009-12-15 23:45:38 +0000
commit931591c0ab434cc330cfdfa324a27278bc4a1270 (patch)
tree99b7bc88a28b3c1949437c8ebf29bdb040abe39b /indra/newview/llviewerhome.cpp
parentdec9e56afe404ac8cbf2bacae87062bf091fdab1 (diff)
EXT-3496: Add a common authentication key for search and home.
Search and the Home sidetray now have their own specific authentication keys that they support from login.cgi, but they fallback to a common key as follows: Search: "search_token", fallback to "auth_token" Home: "home_sidetray_token", fallback to "auth_token"
Diffstat (limited to 'indra/newview/llviewerhome.cpp')
-rw-r--r--indra/newview/llviewerhome.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/llviewerhome.cpp b/indra/newview/llviewerhome.cpp
index 2bae07f665..6299b4fabd 100644
--- a/indra/newview/llviewerhome.cpp
+++ b/indra/newview/llviewerhome.cpp
@@ -48,7 +48,7 @@ std::string LLViewerHome::getHomeURL()
// this value from settings.xml and support various substitutions
LLSD substitution;
- substitution["AUTH_KEY"] = LLURI::escape(getAuthKey());
+ substitution["AUTH_TOKEN"] = LLURI::escape(getAuthKey());
// get the home URL and expand all of the substitutions
// (also adds things like [LANGUAGE], [VERSION], [OS], etc.)
@@ -62,7 +62,13 @@ std::string LLViewerHome::getAuthKey()
// return the value of the (optional) auth token returned by login.cgi
// this lets the server provide an authentication token that we can
// blindly pass to the Home web page for it to perform authentication.
- static const std::string authKeyName("home_sidetray_token");
- return LLLoginInstance::getInstance()->getResponse(authKeyName);
+ // We use "home_sidetray_token", and fallback to "auth_token" if not
+ // present.
+ LLSD auth_token = LLLoginInstance::getInstance()->getResponse("home_sidetray_token");
+ if (auth_token.asString().empty())
+ {
+ auth_token = LLLoginInstance::getInstance()->getResponse("auth_token");
+ }
+ return auth_token.asString();
}