refactor: integrate Better-Auth for authentication and remove Supabase dependencies

This commit is contained in:
Jose Selesan
2026-04-16 20:30:01 -03:00
parent f158845279
commit e5002ce440
29 changed files with 165 additions and 211 deletions

View File

@@ -29,7 +29,7 @@ import type {
UserProfileResponse,
} from '@repo/api-contract';
import axios, { AxiosError } from 'axios';
import { createAuthClient } from "better-auth/react";
import { createAuthClient } from 'better-auth/react';
const apiBaseUrl =
import.meta.env.VITE_API_BASE_URL?.trim() ||
@@ -37,9 +37,11 @@ const apiBaseUrl =
export const authClient = createAuthClient({
baseURL: apiBaseUrl,
fetchOptions: {
credentials: 'include',
},
});
export class ApiClientError extends Error {
status?: number;
details?: unknown;
@@ -66,6 +68,7 @@ const handlers: ErrorHandlers = {};
const http = axios.create({
baseURL: apiBaseUrl,
withCredentials: true,
headers: {
'Content-Type': 'application/json',
},
@@ -285,6 +288,6 @@ export function configureApiClient(nextHandlers: ErrorHandlers) {
handlers.onError = nextHandlers.onError;
}
export function setApiAccessToken(token: string | null) {
export function setApiAccessToken(_token: string | null) {
// accessToken = token;
}