From 8f5d36746d85790b1712db41ed8da458441fcf12 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Tue, 14 Mar 2017 13:47:59 -0700 Subject: [PATCH] [client-app] Correctly sign out of NylasID Summary: This fixes T7995. Previously, attempting to log out from your NylasID would just automatically sign you back in with the same NylasID because the webview session was preserved. Now, instead of relaunching the windows, we restart the app to clear the webview session Test Plan: manual Reviewers: halla, evan Reviewed By: evan Maniphest Tasks: T7995 Differential Revision: https://phab.nylas.com/D4224 --- packages/client-app/src/flux/stores/identity-store.es6 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/client-app/src/flux/stores/identity-store.es6 b/packages/client-app/src/flux/stores/identity-store.es6 index 3151c330e..7a92f7ad8 100644 --- a/packages/client-app/src/flux/stores/identity-store.es6 +++ b/packages/client-app/src/flux/stores/identity-store.es6 @@ -1,6 +1,6 @@ import Rx from 'rx-lite' import NylasStore from 'nylas-store'; -import {ipcRenderer} from 'electron'; +import {ipcRenderer, remote} from 'electron'; import request from 'request'; import url from 'url' @@ -111,7 +111,10 @@ class IdentityStore extends NylasStore { _onLogoutNylasIdentity = async () => { await this.saveIdentity(null) - ipcRenderer.send('command', 'application:relaunch-to-initial-windows'); + // We need to relaunch the app to clear the webview session and allow the + // and prevent the webview from re signing in with the same NylasID + remote.app.relaunch() + remote.app.quit() } _onEnvChanged = () => {