Vibecoded CI/CD
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
A session is a bearer token the API handed us, kept in a cookie rather than
|
||||
localStorage so the server can see it too: the sidebar then knows who is
|
||||
signed in on the very first draw, before any script runs. The token itself is
|
||||
never decoded here — the API is asked who it belongs to (see restoreSession). */
|
||||
never decoded here — the API is asked who it belongs to (see restoreSession).
|
||||
|
||||
In the desktop build the token is kept twice — see keepTokenRemembered, at
|
||||
the foot of this file. */
|
||||
|
||||
export interface AuthUser {
|
||||
id: string
|
||||
@@ -34,6 +37,11 @@ export function useAuth() {
|
||||
maxAge: WEEK_IN_SECONDS,
|
||||
sameSite: 'lax',
|
||||
})
|
||||
/* A window is not owed a cookie jar: its own address is one a webview is not
|
||||
everywhere obliged to store cookies against, and a session that could not
|
||||
outlive the window would ask the person to sign in every time they opened
|
||||
the app. A no-op anywhere else. */
|
||||
keepTokenRemembered(token, TOKEN_COOKIE)
|
||||
const user = useState<AuthUser | null>('auth:user', () => null)
|
||||
|
||||
const loggedIn = computed(() => user.value !== null)
|
||||
|
||||
Reference in New Issue
Block a user