fix(server,stage-web): auth & rename
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@proj-airi/api-server",
|
||||
"name": "@proj-airi/server",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
|
||||
@@ -2,10 +2,10 @@ import type { AppType } from '../../../server/src/app'
|
||||
|
||||
import { hc } from 'hono/client'
|
||||
|
||||
import { SERVER_URL } from '../libs/auth'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { API_SERVER_URL } from './auth'
|
||||
|
||||
export const client = hc<AppType>(API_SERVER_URL, {
|
||||
export const client = hc<AppType>(SERVER_URL, {
|
||||
fetch: (input: RequestInfo | URL, init?: RequestInit) => {
|
||||
const authStore = useAuthStore()
|
||||
const headers = new Headers(init?.headers)
|
||||
|
||||
@@ -2,12 +2,12 @@ import { createAuthClient } from 'better-auth/vue'
|
||||
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
|
||||
export const API_SERVER_URL = import.meta.env.VITE_SERVER_URL || 'https://airi-api.moeru.ai'
|
||||
export const SERVER_URL = import.meta.env.VITE_SERVER_URL || 'https://airi-api.moeru.ai'
|
||||
|
||||
const authStore = useAuthStore()
|
||||
|
||||
export const authClient = createAuthClient({
|
||||
baseURL: API_SERVER_URL,
|
||||
baseURL: SERVER_URL,
|
||||
|
||||
credentials: 'include',
|
||||
fetchOptions: {
|
||||
@@ -3,7 +3,7 @@ import { onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { toast } from 'vue-sonner'
|
||||
|
||||
import { authClient, fetchSession } from '../../composables/auth'
|
||||
import { authClient, fetchSession } from '../../libs/auth'
|
||||
import { useAuthStore } from '../../stores/auth'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -23,7 +23,7 @@ import { breakpointsTailwind, useBreakpoints, useMouse } from '@vueuse/core'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { computed, onMounted, onUnmounted, ref, useTemplateRef, watch } from 'vue'
|
||||
|
||||
import { fetchSession } from '../composables/auth'
|
||||
import { fetchSession } from '../libs/auth'
|
||||
|
||||
const paused = ref(false)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { computed, ref } from 'vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { toast } from 'vue-sonner'
|
||||
|
||||
import { listSessions, signOut } from '../../composables/auth'
|
||||
import { listSessions, signOut } from '../../libs/auth'
|
||||
import { useAuthStore } from '../../stores/auth'
|
||||
|
||||
const authStore = useAuthStore()
|
||||
|
||||
Reference in New Issue
Block a user