Protected ReadonlyclientsProtected ReadonlyconfigProtectedcredentialsProtectedcredentialsIncremented on sign out or a new login being accepted, so results from earlier sessions are discarded.
ProtectedcredentialsProtectedcredentialsProtected ReadonlykeyProtectedkeySerializes the key store updates, so a slow update cannot be applied on top of a later one.
Protected ReadonlyloggerReadonlyonEmitted whenever the sign in state changes.
Protected ReadonlyonProtectedpendingProtectedrefreshRegisters a frontend connection with the shared backend session. Not part of the frontend RPC interface.
Cancels the pending login attempt, if any.
Completes the pending login with a manually provided authorization code or the full redirect URL.
true if the sign in completed
ProtecteddoProtectedenqueueProtectedexchangeReturns the current sign in state.
Returns valid credentials for the ChatGPT endpoint, refreshing the access token when it is about to expire. Backend only: the tokens must not leave the backend, which is what createRemoteAuthService enforces.
ProtectedhandleProtectedloadProtectednotifyProtectedreadProtectedrefreshProtectedrequestProtectedrespondThe messages are application constants, so they need no escaping.
ProtectedsettleRemoves the stored credentials.
ProtectedstartStarts a new login attempt. Cancels a login attempt that is still pending.
the URL the user has to open and whether the local callback listener is available
ProtectedstorePersists a session before publishing it, rolling back a login write if its attempt lost ownership.
Optionalpending: PendingLoginProtectedtoProtectedtoParses a stored session, rejecting anything that could not be used to authenticate a request.
Waits for the browser to deliver the authorization code to the local callback listener.
true if the sign in completed, false if it was cancelled or timed out
Backend implementation of the "Sign in with ChatGPT" OAuth flow. The browser is sent to the OpenAI authorization page and returns the authorization code to a loopback listener. If that listener is not reachable, e.g. because the backend does not run on the user's machine, the code can be handed over manually instead.