- Implemented Issue #9: User Authentication & Authorization - Added User model fields (FailedLoginAttempts, LockedUntil, LastLogin) - Created AuthService with JWT support, bcrypt hashing, and account lockout - Added AuthMiddleware and AuthHandler - Registered auth routes in backend - Created AuthContext and RequireAuth component in frontend - Implemented Login page and integrated with backend - Fixed 'Blank Page' issue in local Docker environment - Added QueryClientProvider to main.tsx - Installed missing lucide-react dependency - Fixed TypeScript linting errors in SetupGuard.tsx - Updated docker-entrypoint.sh to use 127.0.0.1 for reliable Caddy checks - Verified with local Docker build
21 lines
449 B
TypeScript
21 lines
449 B
TypeScript
import client from './client';
|
|
|
|
export interface SetupStatus {
|
|
setupRequired: boolean;
|
|
}
|
|
|
|
export interface SetupRequest {
|
|
name: string;
|
|
email: string;
|
|
password: string;
|
|
}
|
|
|
|
export const getSetupStatus = async (): Promise<SetupStatus> => {
|
|
const response = await client.get<SetupStatus>('/setup');
|
|
return response.data;
|
|
};
|
|
|
|
export const performSetup = async (data: SetupRequest): Promise<void> => {
|
|
await client.post('/setup', data);
|
|
};
|