Skip to content

Commit fdf79d7

Browse files
author
Steven Hammerton
committed
Replace CAS login with token login
1 parent 942659d commit fdf79d7

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)