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
This commit is contained in:
Truman Gao
2026-03-31 10:15:35 -07:00
committed by GitHub
parent e2bfed177d
commit 4224ef45b3
6 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
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')

View File

@@ -1,5 +1,6 @@
export * from './api-client'
export * from './app-backup'
export * from './auth'
export * from './content-manager'
export { createContext } from './create-context'
export * from './file-picker'