add auth via uuid only
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user