PERN authentication [postgresql, express, react, nodejs]
d_auth=# table users;
user_id | email | password | created_at
---------+------------------+--------------------------------------------------------------+------------
1 | test@gmail.com | $2a$10$HuXD3Q.mru438HHgZ.oDzuroyqvuhwZtlHiC/QZ6C0CV6HilNaJeu | 2023-11-26
2 | test6@gmail.com | $2a$10$9.U3/ghrgyLWYEKsm4S9AOZ9sUxq3ANvLsgCS6DFRXleVR8FQDOeC | 2023-11-26
3 | test61@gmail.com | $2a$10$TWBwYMikcJj6tQXkebTCHeLH7OyZZBZvupHD/f6fJcMSX8OGdwX4C | 2023-11-26
(3 rows)
{
"success": true,
"users": [
{
"user_id": 1,
"email": "test@gmail.com"
},
{
"user_id": 2,
"email": "test6@gmail.com"
},
{
"user_id": 3,
"email": "test61@gmail.com"
}
]
}
{
"email": "test61@gmail.com",
"password": "1234567"
}
{
"success": true,
"users": [
{
"user_id": 1,
"email": "test@gmail.com"
},
{
"user_id": 2,
"email": "test6@gmail.com"
},
{
"user_id": 3,
"email": "test61@gmail.com"
}
]
}
{
"email": "test61@gmail.com",
"password": "1234567"
}
token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJ0ZXN0NjFAZ21haWwuY29tIiwiaWF0IjoxNzAxMDQ1MzY1fQ.axlPxy1LlWPXEkobA7H7wEcCOJXMOqS3sl5PRHmMWUM; Path=/; HttpOnly
{
"success": true,
"message": "Logged in succefully"
}
{
"email": "test61@gmail.com",
"password": "1234567"
}
{
"info": "secured data is available"
}
{
"email": "test61@gmail.com",
"password": "1234567"
}
{
"success": true,
"message": "Logged out succefully"
}