pub async fn authenticate_user(
context: &Context<'_>,
user_name: &str,
password: &str,
) -> Result<UserIdentifier>Expand description
Authenticates a user with their username and password.
This function reads the user’s file from the filesystem, compares the provided password hash with the stored hash, and returns the user’s identifier if authentication succeeds.
§Errors
FailedToGetUserFilePath- Invalid username or path construction failureFailedToOpenUserFile- User file doesn’t exist or permission deniedFailedToReadUserFile- I/O error reading user fileFailedToParseUserFile- Invalid JSON format in user fileInvalidPassword- Password doesn’t match stored hash