mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
With the introduction of the "connect on start" configuration option, we introduced a bug where the GUI client said "Signed in as ..." even though we did not have a `connlib` session. The tray-menu handles this state correctly and clicking sign out and sign in restores Firezone to a functional state. This disparity happened because we assumed that having a token means we must have a session. To fix this, we introduce a new `SessionViewModel` that combines the state of the auth session and the `connlib` state. Only if we have both do we infer that we are "signed in". This also requires us to introduce an intermediary state where we are "loading". This is represented as a spinner in the UI. Last but not least, this also removes the automated hiding of the client window. In a prior design, the only job of this window was to show the "Sign in" button so it wasn't useful beyond clicking that. Now that we show more things in this window, automatically hiding it might confuse the user. Here is what this new design looks like: [Login flow](https://github.com/user-attachments/assets/276e390b-4837-48e2-aaf1-eea007472816) As a result of other improvements around "zero-click sign-in", the user often doesn't even have to switch to the browser window because sign-in happens in the background. Unfortunately, the tab still remains open but that is outside of our control (at least on Linux).
10 lines
173 B
TypeScript
10 lines
173 B
TypeScript
export type SessionViewModel =
|
|
{
|
|
SignedIn: {
|
|
account_slug: string;
|
|
actor_name: string
|
|
}
|
|
} |
|
|
"Loading" |
|
|
"SignedOut";
|