Skip to content

feat: Implement authentication flow #189

Description

@ApostolisFalaras

Description

Implement the frontend authentication behavior for the BaseQL desktop application.

Users authenticate using a username and password. Successful authentication should establish the frontend authentication state and allow access to the protected SQL management interface.

This issue connects the authentication UI created in the application layout issue to the backend authentication API.

Tasks

  • Update the authentication form to use username and password
  • Manage username and password form state
  • Add password visibility toggle behavior
  • Validate required authentication fields
  • Create authentication service functions: Login, Logout, Fetch/restore current authentication state if required
  • Submit credentials to the backend login endpoint
  • Store/manage the returned authentication token securely
  • Add the Bearer token to authenticated API requests
  • Create application-level authentication state
  • Protect the main application route
  • Redirect unauthenticated users to the login page
  • Redirect successfully authenticated users to the SQL workspace
  • Handle invalid credentials
  • Handle authentication/network errors
  • Add login loading state
  • Implement logout from the application header/profile area
  • Clear authentication state when the token is invalid or expired
  • Restore authentication appropriately when the desktop application is reopened, if persistent sessions are supported

Acceptance Criteria

  • Users can authenticate with a username and password.
  • Invalid credentials produce a clear error without leaving the login page.
  • Successful authentication opens the main SQL interface.
  • Unauthenticated users cannot access protected application routes.
  • Authenticated API requests include the configured authentication credentials.
  • Logout clears authentication state and returns the user to the login page.
  • Expired or invalid authentication credentials return the user to the authentication page.
  • Authentication behavior is separated from presentation components where practical.

Depends On

  • feat: Implement React application layout and authentication page
  • feat: Implement frontend API service layer

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

UI-ReactFrontend UI for DBMSfeatureComponent feature

Projects

  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions