You've already forked AstralRinth
c69f24f94d
* feat: publish api-client to npm * feat: change hosting wording + examples * GPL -> LGPL * fix: remove manual publishing + git url * fix: lint * fix: lint
15 lines
498 B
TypeScript
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')
|