Files
BarangaySystem/ai-docs/files/LoginController.md
2026-06-06 18:43:00 +08:00

858 B

LoginController.php

Purpose

Handles user authentication including login, session extension, and logout operations.

Key Components

  • LoginController class
  • authenticate() method
  • extendcurrentSession() method

Exported Interfaces

  • authenticate() - Authenticate user via JWT
  • extendcurrentSession() - Extend current session lifetime

Inputs

  • $request - HTTP request with username/password
  • Session data for token validation

Outputs

  • Redirect to home page on success
  • JSON response on failure
  • Session creation on successful authentication

Side Effects

  • Creates JWT-based session
  • Sets session cookie

Dependencies

  • Hypervel\Support\Facades\Auth
  • App\Models\User

Notes

  • Uses JWT authentication via Hypervel framework
  • Validates credentials against database
  • Supports both web and API authentication