Merge pull request #2808 from vector-im/matthew/electron-captcha2
make electron send email validation URLs with a nextlink of riot.im
This commit is contained in:
commit
b06d045188
3 changed files with 15 additions and 5 deletions
|
@ -130,6 +130,7 @@ The only platform that can build packages for all three platforms is macOS:
|
||||||
```
|
```
|
||||||
brew install wine --without-x11
|
brew install wine --without-x11
|
||||||
brew install mono
|
brew install mono
|
||||||
|
brew install gnu-tar
|
||||||
npm install
|
npm install
|
||||||
npm run build:electron
|
npm run build:electron
|
||||||
```
|
```
|
||||||
|
|
|
@ -3,7 +3,7 @@ const spawn = require('child_process').spawn;
|
||||||
const app = require('electron').app;
|
const app = require('electron').app;
|
||||||
|
|
||||||
function run_update_exe(args, done) {
|
function run_update_exe(args, done) {
|
||||||
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
|
const updateExe = path.resolve(path.dirname(process.execPath), 'Update.exe');
|
||||||
spawn(updateExe, args, {
|
spawn(updateExe, args, {
|
||||||
detached: true
|
detached: true
|
||||||
}).on('close', done);
|
}).on('close', done);
|
||||||
|
|
|
@ -136,11 +136,20 @@ 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() {
|
||||||
return window.location.protocol + '//' +
|
if (window.location.protocol === "file:") {
|
||||||
window.location.host +
|
return 'https://riot.im/app/#/register';
|
||||||
window.location.pathname +
|
}
|
||||||
'#/register';
|
else {
|
||||||
|
return window.location.protocol + '//' +
|
||||||
|
window.location.host +
|
||||||
|
window.location.pathname +
|
||||||
|
'#/register';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('hashchange', onHashChange);
|
window.addEventListener('hashchange', onHashChange);
|
||||||
|
|
Loading…
Reference in a new issue