Changes between Version 1 and Version 2 of UserLogin


Ignore:
Timestamp:
01/22/26 02:33:03 (17 hours ago)
Author:
221296
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserLogin

    v1 v2  
    11== User Login
    22
    3 ==== Actors: **Registered User (USER)**
     3==== Actors: **Registered User (USER / ADMIN / INSTRUCTOR)**
    44
    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.”.
     6The system checks whether a user with the given email exists in the database.
    97
    108{{{#!sql
    11 SELECT *
     9SELECT id, password, role
    1210FROM user_entity
    13 WHERE email = 'user@email.com';
     11WHERE email = :email;
     12
    1413
    1514
    1615}}}
     16
     17**2.** Password Validation (Application Logic).
     18The entered password is compared with the stored hashed password.
     19If the password is invalid, the login process is stopped.
     20If the password is valid, the process continues.
     21
     22**3.** Load User Type Based on Role.
     23After successful authentication, the system loads the user type according to the role.
     24
     25If the role is USER:
     26{{{#!sql
     27SELECT id
     28FROM users
     29WHERE id = :userId;
     30
     31
     32
     33}}}
     34
     35If the role is ADMIN:
     36{{{#!sql
     37SELECT id
     38FROM administrators
     39WHERE id = :userId;
     40
     41
     42
     43
     44}}}
     45
     46If the role is INSTRUCTOR:
     47{{{#!sql
     48SELECT id
     49FROM instructors
     50WHERE id = :userId;
     51
     52
     53
     54}}}