Skip to content

Commit b06d045

Browse files
authored
Merge pull request element-hq#2808 from vector-im/matthew/electron-captcha2
make electron send email validation URLs with a nextlink of riot.im
2 parents 43f82cd + 79d1643 commit b06d045

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ The only platform that can build packages for all three platforms is macOS:
130130
```
131131
brew install wine --without-x11
132132
brew install mono
133+
brew install gnu-tar
133134
npm install
134135
npm run build:electron
135136
```

‎electron/src/squirrelhooks.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const spawn = require('child_process').spawn;
33
const app = require('electron').app;
44

55
function run_update_exe(args, done) {
6-
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
6+
const updateExe = path.resolve(path.dirname(process.execPath), 'Update.exe');
77
spawn(updateExe, args, {
88
detached: true
99
}).on('close', done);

‎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)