feat(frontend): Refactor auth and split into separate files
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { UserApi, Configuration, type CreateUserDto, type UserDto } from '~/.api-client'
|
||||
import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
|
||||
import { useAuthState } from '~/composables/auth/useAuthState'
|
||||
|
||||
export function useUserApi() {
|
||||
const appBaseUrl = useRuntimeConfig().app.baseURL
|
||||
const { serverApiBaseUrl, serverApiBasePath, clientProxyBasePath } = useRuntimeConfig().public
|
||||
const { jwt } = useAuth()
|
||||
const { jwt } = useAuthState()
|
||||
|
||||
const basePath = withoutTrailingSlash(
|
||||
cleanDoubleSlashes(import.meta.client ? appBaseUrl + clientProxyBasePath : serverApiBaseUrl + serverApiBasePath)
|
||||
|
||||
Reference in New Issue
Block a user