[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
This commit is contained in:
Juan Tejada 2017-03-14 13:47:59 -07:00
parent 6ea9ab3fbf
commit 8f5d36746d

View file

@ -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 = () => {