feat: update API client and remove unused services; enhance error handling and configuration

This commit is contained in:
JSC
2025-07-26 19:49:00 +02:00
parent 6ce83c8317
commit 6018a5c8c5
14 changed files with 14 additions and 606 deletions

View File

@@ -36,23 +36,13 @@ export function AuthProvider({ children }: AuthProviderProps) {
}, [])
const login = async (credentials: LoginRequest) => {
try {
const user = await api.auth.login(credentials)
setUser(user)
} catch (error) {
console.error('Login failed:', error)
throw error
}
const user = await api.auth.login(credentials)
setUser(user)
}
const register = async (data: RegisterRequest) => {
try {
const user = await api.auth.register(data)
setUser(user)
} catch (error) {
console.error('Registration failed:', error)
throw error
}
const user = await api.auth.register(data)
setUser(user)
}
const logout = async () => {
@@ -62,7 +52,6 @@ export function AuthProvider({ children }: AuthProviderProps) {
const value: AuthContextType = {
user,
token: user ? 'cookie-based' : null,
login,
register,
logout,