Skip to content

Commit d462e0b

Browse files
committed
Merge pull request element-hq#335 from stevenhammerton/sh-cas-token-login
Replace CAS login with token login
2 parents 942659d + fdf79d7 commit d462e0b

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎src/vector/index.js‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,21 @@ function parseQsFromFragment(location) {
6565
return {};
6666
}
6767

68+
function parseQs(location) {
69+
return qs.parse(location.search.substring(1));
70+
}
71+
6872
// Here, we do some crude URL analysis to allow
6973
// deep-linking. We only support registration
7074
// deep-links in this example.
7175
function routeUrl(location) {
72-
if (location.hash.indexOf('#/register') == 0) {
76+
var params = parseQs(location);
77+
var loginToken = params.loginToken;
78+
if (loginToken) {
79+
window.matrixChat.showScreen('token_login', parseQs(location));
80+
}
81+
else if (location.hash.indexOf('#/register') == 0) {
7382
window.matrixChat.showScreen('register', parseQsFromFragment(location));
74-
} else if (location.hash.indexOf('#/login/cas') == 0) {
75-
window.matrixChat.showScreen('cas_login', parseQsFromFragment(location));
7683
} else {
7784
window.matrixChat.showScreen(location.hash.substring(2));
7885
}

0 commit comments

Comments
 (0)