You've already forked AstralRinth
forked from didirus/AstralRinth
4224ef45b3
* feat: add shared UI package auth DI * use refs instead of reactive * pnpm prepr * move app auth provider setup to src/providers/setup
13 lines
422 B
TypeScript
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')
|