| | 1 | == Use-case 0001 - Login |
| | 2 | '''Initiating actor:''' Guest |
| | 3 | |
| | 4 | '''Other actors:''' None |
| | 5 | |
| | 6 | '''Description:''' |
| | 7 | A guest wants to access their personalized profile in the system. If the guest attempts to perform a restricted action, they must log in. The guest logs in by providing a username and password. The system verifies the credentials and if valid, starts an authenticated session. |
| | 8 | |
| | 9 | '''Scenario:''' |
| | 10 | 1. Guest goes to the login page. |
| | 11 | 2. Guest enters their username and password credentials. |
| | 12 | 3. System checks the database to verify if the credentials exist and if they are correct: |
| | 13 | {{{ |
| | 14 | #!sql |
| | 15 | SELECT |
| | 16 | user_id, |
| | 17 | username, |
| | 18 | email, |
| | 19 | first_name, |
| | 20 | last_name |
| | 21 | FROM users |
| | 22 | WHERE username = 'owner_bojan' |
| | 23 | AND password = '$2a$10$hashed_pw_bojan'; |
| | 24 | }}} |
| | 25 | 4. The user logs in, the system determines their role (Owner, Sitter, or Admin), and redirects them to their dashboard. |