forked from
joebasser.com/atmosphere-account
this repo has no description
1import { createDefine } from "fresh";
2import type { Locale } from "./i18n/locales.ts";
3import type { RememberedAccount } from "./lib/remembered-accounts.ts";
4import type { AccountType } from "./lib/account-types.ts";
5
6export interface SessionUser {
7 did: string;
8 handle: string;
9}
10
11export interface State {
12 /** Active locale for this request. Set by the locale middleware. */
13 locale: Locale;
14 /** Logged-in registry account, or null when signed out. Set by sessionMiddleware. */
15 user: SessionUser | null;
16 /** Local account role: users manage reviews, projects manage registry profiles. */
17 accountType: AccountType | null;
18 /** Accounts that have completed OAuth on this device, in
19 * most-recently-used order. Populated by sessionMiddleware so
20 * routes can hand the list to AccountMenu for the switcher. */
21 rememberedAccounts: RememberedAccount[];
22 // deno-lint-ignore no-explicit-any
23 [key: string]: any;
24}
25
26export const define = createDefine<State>();