From fdf79d709eacf1176be7a9ff87867dd0c1ae7b76 Mon Sep 17 00:00:00 2001 From: Steven Hammerton Date: Fri, 6 Nov 2015 11:22:59 +0000 Subject: [PATCH] Replace CAS login with token login --- src/vector/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index 298861973..45d69001b 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -65,14 +65,21 @@ function parseQsFromFragment(location) { return {}; } +function parseQs(location) { + return qs.parse(location.search.substring(1)); +} + // Here, we do some crude URL analysis to allow // deep-linking. We only support registration // deep-links in this example. function routeUrl(location) { - if (location.hash.indexOf('#/register') == 0) { + var params = parseQs(location); + var loginToken = params.loginToken; + if (loginToken) { + window.matrixChat.showScreen('token_login', parseQs(location)); + } + else if (location.hash.indexOf('#/register') == 0) { window.matrixChat.showScreen('register', parseQsFromFragment(location)); - } else if (location.hash.indexOf('#/login/cas') == 0) { - window.matrixChat.showScreen('cas_login', parseQsFromFragment(location)); } else { window.matrixChat.showScreen(location.hash.substring(2)); }