Refactored GitHub login and added error handling for failed logins