add auth via uuid only

This commit is contained in:
2026-01-31 15:25:33 +01:00
parent 57020a8913
commit f919079f69
9 changed files with 113 additions and 22 deletions

View File

@@ -100,12 +100,15 @@ class DirectusService {
headers
});
// Token abgelaufen - versuche Refresh
if (response.status === 401 && this.refreshToken) {
// Token abgelaufen - versuche Refresh (aber nicht für auth-Endpoints)
if (response.status === 401 && this.refreshToken && !endpoint.startsWith('/auth/')) {
const refreshed = await this.refreshSession();
if (refreshed) {
headers['Authorization'] = `Bearer ${this.accessToken}`;
return this.request(endpoint, options);
} else {
// Refresh failed - clear tokens to prevent loops
this.clearTokens();
}
}
@@ -216,13 +219,9 @@ class DirectusService {
return false;
}
async register(email, password, userData = {}) {
return this.post('/users', {
email,
password,
...userData,
role: null // Wird durch Directus Flow/Policy gesetzt
});
async register(email, password) {
// Public registration (no verification required)
return this.post('/users/register', { email, password });
}
async requestPasswordReset(email) {