mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
24 lines
597 B
TypeScript
24 lines
597 B
TypeScript
|
|
import { ENV_VARIABLES } from '../constants';
|
||
|
|
|
||
|
|
class AuthService {
|
||
|
|
|
||
|
|
private BASE_URL: string;
|
||
|
|
|
||
|
|
constructor() {
|
||
|
|
this.BASE_URL = ENV_VARIABLES.VITE_BACKEND_URL;
|
||
|
|
}
|
||
|
|
|
||
|
|
async fetchAuthData(){
|
||
|
|
try {
|
||
|
|
const response = await fetch(`${this.BASE_URL}/api/auth/getActiveAuth`);
|
||
|
|
const data = await response.json();
|
||
|
|
return data.authActive;
|
||
|
|
} catch (error) {
|
||
|
|
console.error('Erreur lors de la récupération des données d\'auth:', error);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
const authService = new AuthService();
|
||
|
|
export default authService;
|