Fixed the login and extraction of roles