From f321512d5af95a9b18deb38be4de2e58d8ce1953 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 24 Dec 2016 03:18:12 +0000 Subject: [PATCH] make electron send email validation URLs with a nextlink of riot.im rather than file:/// --- src/vector/index.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index b791783b98..8231950b49 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -136,11 +136,20 @@ var onNewScreen = function(screen) { // click back to the client having registered. // It's up to us to recognise if we're loaded with // 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() { - return window.location.protocol + '//' + - window.location.host + - window.location.pathname + - '#/register'; + if (window.location.protocol === "file:") { + return 'https://riot.im/app/#/register'; + } + else { + return window.location.protocol + '//' + + window.location.host + + window.location.pathname + + '#/register'; + } } window.addEventListener('hashchange', onHashChange);