Skip to content

Commit 9a861f4

Browse files
committed
make electron send email validation URLs with a nextlink of riot.im rather than file:///
1 parent bb28903 commit 9a861f4

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎src/vector/index.js‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,20 @@ var onNewScreen = function(screen) {
136136
// click back to the client having registered.
137137
// It's up to us to recognise if we're loaded with
138138
// this URL and tell MatrixClient to resume registration.
139+
//
140+
// If we're in electron, we should never pass through a file:// URL otherwise
141+
// the identity server will try to 302 the browser to it, which breaks horribly.
142+
// so in that instance, hardcode to use riot.im/app for now instead.
139143
var makeRegistrationUrl = function() {
140-
return window.location.protocol + '//' +
141-
window.location.host +
142-
window.location.pathname +
143-
'#/register';
144+
if (window.location.protocol === "file:") {
145+
return 'https://riot.im/app/#/register';
146+
}
147+
else {
148+
return window.location.protocol + '//' +
149+
window.location.host +
150+
window.location.pathname +
151+
'#/register';
152+
}
144153
}
145154

146155
window.addEventListener('hashchange', onHashChange);

0 commit comments

Comments
 (0)