Files
AstralRinth/packages/ui/src/providers/auth.ts
T
Truman Gao 4224ef45b3 feat: add shared UI package auth DI (#5720)
* feat: add shared UI package auth DI

* use refs instead of reactive

* pnpm prepr

* move app auth provider setup to src/providers/setup
2026-03-31 17:15:35 +00:00

13 lines
422 B
TypeScript

import type { Labrinth } from '@modrinth/api-client/src/modules/labrinth/types'
import type { Ref } from 'vue'
import { createContext } from './create-context'
export interface AuthProvider {
session_token: Ref<string | null>
user: Ref<Labrinth.Users.v2.User | null>
requestSignIn: (redirectPath: string) => void | Promise<void>
}
export const [injectAuth, provideAuth] = createContext<AuthProvider>('root', 'auth')