Skip to content

Commit

Permalink
fix: set auth config first
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Sep 18, 2024
1 parent 6a56766 commit a281f58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/renderer/src/initialize/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { env } from "@env"
import { authConfigManager } from "@hono/auth-js/react"
import { repository } from "@pkg"
import { getUISettings } from "@renderer/atoms/settings/ui"
import { isElectronBuild } from "@renderer/constants"
Expand Down Expand Up @@ -105,12 +103,6 @@ export const initializeApp = async () => {
CleanerService.cleanOutdatedData()
}

// Initialize the auth config
authConfigManager.setConfig({
baseUrl: env.VITE_API_URL,
basePath: "/auth",
credentials: "include",
})
const loadingTime = Date.now() - now
appLog(`Initialize ${APP_NAME} done,`, `${loadingTime}ms`)

Expand Down
9 changes: 9 additions & 0 deletions src/renderer/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import "./styles/main.css"

import { env } from "@env"
import { authConfigManager } from "@hono/auth-js/react"
import { ClickToComponent } from "click-to-react-component"
import * as React from "react"
import ReactDOM from "react-dom/client"
Expand All @@ -11,6 +13,13 @@ import { initializeApp } from "./initialize"
import { getOS } from "./lib/utils"
import { router } from "./router"

// Initialize the auth config
authConfigManager.setConfig({
baseUrl: env.VITE_API_URL,
basePath: "/auth",
credentials: "include",
})

initializeApp().finally(() => {
setAppIsReady(true)
})
Expand Down

0 comments on commit a281f58

Please sign in to comment.