The frontend listens to ElectronRendererAuthorization.onAccessTokenChanged and calls await ElectronRendererAuthorization.signIn().
The backend ElectronMainAuthorization kicks off a sign in request.
The frontend signIn() promise resolves, and a "signing in..." page is shown
User enters username and password, logs in successfully to get an Authorization Code.
While swapping the Authorization Code for a token, the tokenUrl server (called inside ElectronMainAuthorization.swapAuthorizationCodeForTokens) throws a 500 Internal Server Error (happens rarely, but enough to be a bother in our CI).
Our backend throws the error and but frontend is left hanging on the "signing in..." page because onAccessTokenChanged is never called.
Ideally, I'd like the signIn() to resolve or reject once the entire sign in process is complete, not just after starting the process, that way our frontend can properly react to events or errors. If not that is not possible, at the very least there should at least be a way for our backend to catch the signIn() errors initiated through IPC by the frontend, or an event we can hook into, so we can tell the frontend ourselves.
Execution flow for our Electron App:
ElectronRendererAuthorization.onAccessTokenChanged
and callsawait ElectronRendererAuthorization.signIn()
.ElectronMainAuthorization
kicks off a sign in request.signIn()
promise resolves, and a "signing in..." page is showntokenUrl
server (called insideElectronMainAuthorization.swapAuthorizationCodeForTokens
) throws a500 Internal Server Error
(happens rarely, but enough to be a bother in our CI).onAccessTokenChanged
is never called.Ideally, I'd like the
signIn()
to resolve or reject once the entire sign in process is complete, not just after starting the process, that way our frontend can properly react to events or errors. If not that is not possible, at the very least there should at least be a way for our backend to catch thesignIn()
errors initiated through IPC by the frontend, or an event we can hook into, so we can tell the frontend ourselves.Happy to look into this.