= UseCase01 - Patient LoginAuthentication = == Initiating Actor - `Patient` == == Description == A patient logs into the Medora healthcare system using their username and password. The system verifies the credentials and then it checks if the account is active, and grants access to the patient portal. == Scenario == 1. Patient navigates to the Medora login page. 2. Patient enters their username and password and submits the login form. {{{ #!sql SELECT u.user_id, u.username, u.password, u.role, u.first_name, u.last_name, u.is_active FROM users u WHERE u.username = 'maja.veljanova'; }}} 3. System verifies if the account is active and the password matches. {{{ #!sql SELECT u.user_id FROM users u WHERE u.username = 'maja.veljanova' AND u.is_active = TRUE; }}} 4. System retrieves the linked patient profile. {{{ #!sql SELECT p.patient_id, p.date_of_birth, p.gender, p.phone_number, p.embg FROM patients p WHERE p.user_id = (SELECT user_id FROM users WHERE username = 'maja.veljanova'); }}} 5. Patient is authenticated and then redirected to their profile dashboard.