Add settings endpoints and registration status check: implement new API endpoints for settings management, including registration status retrieval, and update the registration command handler to enforce registration rules based on site settings.
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import { apiRequest, setAccessToken } from '@/shared/api/client'
|
||||
import type { AuthResponse, CurrentUser } from '@/shared/api/types'
|
||||
import type { AuthResponse, CurrentUser, RegistrationStatus } from '@/shared/api/types'
|
||||
import { useAuthStore } from './store'
|
||||
|
||||
/** Публично: включена ли открытая регистрация (для страниц входа/регистрации). */
|
||||
export function fetchRegistrationStatus() {
|
||||
return apiRequest<RegistrationStatus>('/auth/registration')
|
||||
}
|
||||
|
||||
export function login(userName: string, password: string) {
|
||||
return apiRequest<AuthResponse>('/auth/login', { method: 'POST', body: { userName, password } })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user