add: webseite mit jwt

This commit is contained in:
Philippe Torrel
2026-09-01 12:05:06 +02:00
parent 2aef8b91bd
commit c1774746c9
311 changed files with 34382 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
import { apiClient, getApiErrorMessage } from '../http';
export { getApiErrorMessage };
export const loginRequest = async (username, password) => {
const { data } = await apiClient.post('/login', { username, password });
if (!data?.user || !data?.token) {
throw new Error('Ungültige API-Antwort: Session erwartet');
}
return data;
};
export const logoutRequest = async () => {
await apiClient.post('/logout');
};
export const fetchMe = async (config = {}) => {
const { data } = await apiClient.get('/me', config);
return data;
};