added the first version of the authentication logic