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

@@ -106,6 +106,7 @@ import {
} from '@/providers/download-progress.ts'
import { createServerInstall, provideServerInstall } from '@/providers/server-install'
import { setupProviders } from '@/providers/setup'
import { setupAuthProvider } from '@/providers/setup/auth'
import { useError } from '@/store/error.js'
import { useLoading, useTheming } from '@/store/state'
@@ -454,6 +455,10 @@ const credentials = ref()
const modrinthLoginFlowWaitModal = ref()
setupAuthProvider(credentials, async (_redirectPath) => {
await signIn()
})
async function fetchCredentials() {
const creds = await getCreds().catch(handleError)
if (creds && creds.user_id) {