Challenge 1: Eliminate Exceptions Using the Either Monad
Explore how to refactor PHP authentication logic to eliminate exceptions by using the Either monad. Learn to handle invalid usernames and passwords with clear error messages and enhance user data by adding roles and removing sensitive information.
A code snippet is given below. It has an authenticateUser function that authenticates the provided username and password with the stored username and password. If ...