Answer the question
In order to leave comments, you need to log in
User DB in Redis?
Hello everyone, how to store user registration data in Redis?
The user database is stored in Redis.
The following fields are stored for each user:
Id
name
email
password_hash
It is necessary to authorize the user by email and password (for a combination of email, password_hash get user data).
functions in php:
/**
* Creates new user
*
* @param array $user_data User data contains the following fields:
* - name
* - email
* - password_hash
*
* @return string Returns ID of created user
*
* @throws \UserExistsException Throws exception if user with this email already exists
*
*/
function create_user(array $user_data)
{
// your code here
}
/**
* Finds user by combination of email and password hash
*
* @param string $email
* @param string $password_hash
*
* @return string|null Returns ID of user or null if user not found
*/
function authorize_user($email, $password_hash)
{
// your code here
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question