Files
AstralRinth/packages/ui/src/providers/auth.ts
T
Calum H. c69f24f94d feat: publish api-client to npm (#6016)
* feat: publish api-client to npm

* feat: change hosting wording + examples

* GPL -> LGPL

* fix: remove manual publishing + git url

* fix: lint

* fix: lint
2026-05-06 22:39:06 +00:00

15 lines
498 B
TypeScript

import type { Labrinth } from '@modrinth/api-client'
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>
/** True once the initial auth check has completed (regardless of result). */
isReady?: Ref<boolean>
requestSignIn: (redirectPath: string) => void | Promise<void>
}
export const [injectAuth, provideAuth] = createContext<AuthProvider>('root', 'auth')