From f2f5496b78f54c098c79e83a9e8d33d6ebeb35b8 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 19 Nov 2015 11:41:32 +0000 Subject: [PATCH] Get email auth sending working (not the link back though) --- src/Signup.js | 8 +++++++- src/SignupStages.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Signup.js b/src/Signup.js index 79686b7abf..db69441d6f 100644 --- a/src/Signup.js +++ b/src/Signup.js @@ -184,7 +184,13 @@ class Register extends Signup { return stage.complete().then(function(request) { if (request.auth) { return self._tryRegister(request.auth); - } + } + else { + // never resolve the promise chain. This is for things like email auth + // which display a "check your email" message and relies on the + // link in the email to actually register you. + return q.defer().promise; + } }); } diff --git a/src/SignupStages.js b/src/SignupStages.js index a4d7ac9d17..3521b4ba39 100644 --- a/src/SignupStages.js +++ b/src/SignupStages.js @@ -119,7 +119,7 @@ class EmailIdentityStage extends Stage { "&is_url=" + encodeURIComponent(this.signupInstance.getIdentityServerUrl()) + "&session_id=" + - encodeURIComponent(this.signupInstance.getSessionId()); + encodeURIComponent(this.signupInstance.params.sessionId); return this.client.requestEmailToken( this.signupInstance.email,