refactor: move GitHub tokens to main#1942
Conversation
a275545 to
f4f6042
Compare
refactor: remove octokit from renderer
deduplication, dead code, declaration order
Ensure the main process Octokit is initialized before queued IPC messages are flushed. Ensuring an authenticated octokit connection avoids edge cases like loading a private gist on startup.
f4f6042 to
489fd5a
Compare
489fd5a to
813c174
Compare
dsanders11
left a comment
There was a problem hiding this comment.
I think there's a regression here in regards to Internet access that we should resolve before merging.
From my reading of the code, if you successfully logged in, and then at a later time start Fiddle while offline, we'll keep the token on disk but the renderer will show the user as not being logged in with GitHub. Becoming online while Fiddle is still running would leave the app in a logged out state even though the user has a valid token.
I think the behavior we want is that when offline the user should still be shown as logged in as long as they have a token on disk. They should be able to click the log out button and clear the token. Logging in while offline will fail.
If we don't use the user's login name anywhere in the renderer, we may want to change ElectronFiddle.gitHubCheckAuth() to return { loggedIn: boolean } or something like that. In the offline case the main process would still return { loggedIn: true } if there's a token on disk, as that's all the renderer needs to know.
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Good call. 76dbba0 |
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Part six in a series to move GitHub token + gist management into the main process.
This PR: