Changes between Version 1 and Version 2 of UserLogin
- Timestamp:
- 01/22/26 02:33:03 (17 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserLogin
v1 v2 1 1 == User Login 2 2 3 ==== Actors: **Registered User (USER )**3 ==== Actors: **Registered User (USER / ADMIN / INSTRUCTOR)** 4 4 5 **1.** The user enters email and password.”. 6 7 **2.** The system checks whether a user with these credentials exists. 8 5 **1.** Check if User Exists.”. 6 The system checks whether a user with the given email exists in the database. 9 7 10 8 {{{#!sql 11 SELECT *9 SELECT id, password, role 12 10 FROM user_entity 13 WHERE email = 'user@email.com'; 11 WHERE email = :email; 12 14 13 15 14 16 15 }}} 16 17 **2.** Password Validation (Application Logic). 18 The entered password is compared with the stored hashed password. 19 If the password is invalid, the login process is stopped. 20 If the password is valid, the process continues. 21 22 **3.** Load User Type Based on Role. 23 After successful authentication, the system loads the user type according to the role. 24 25 If the role is USER: 26 {{{#!sql 27 SELECT id 28 FROM users 29 WHERE id = :userId; 30 31 32 33 }}} 34 35 If the role is ADMIN: 36 {{{#!sql 37 SELECT id 38 FROM administrators 39 WHERE id = :userId; 40 41 42 43 44 }}} 45 46 If the role is INSTRUCTOR: 47 {{{#!sql 48 SELECT id 49 FROM instructors 50 WHERE id = :userId; 51 52 53 54 }}}
