mirror of https://github.com/vector-im/riot-web
make electron send email validation URLs with a nextlink of riot.im rather than file:///
parent
bb28903c8e
commit
9a861f46d0
|
@ -136,12 +136,21 @@ var onNewScreen = function(screen) {
|
||||||
// click back to the client having registered.
|
// click back to the client having registered.
|
||||||
// It's up to us to recognise if we're loaded with
|
// It's up to us to recognise if we're loaded with
|
||||||
// this URL and tell MatrixClient to resume registration.
|
// this URL and tell MatrixClient to resume registration.
|
||||||
|
//
|
||||||
|
// If we're in electron, we should never pass through a file:// URL otherwise
|
||||||
|
// the identity server will try to 302 the browser to it, which breaks horribly.
|
||||||
|
// so in that instance, hardcode to use riot.im/app for now instead.
|
||||||
var makeRegistrationUrl = function() {
|
var makeRegistrationUrl = function() {
|
||||||
|
if (window.location.protocol === "file:") {
|
||||||
|
return 'https://riot.im/app/#/register';
|
||||||
|
}
|
||||||
|
else {
|
||||||
return window.location.protocol + '//' +
|
return window.location.protocol + '//' +
|
||||||
window.location.host +
|
window.location.host +
|
||||||
window.location.pathname +
|
window.location.pathname +
|
||||||
'#/register';
|
'#/register';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
window.addEventListener('hashchange', onHashChange);
|
window.addEventListener('hashchange', onHashChange);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue