arckinteractive / elgg_hybridauth

HybridAuth Client for Elgg
10 stars 9 forks source link

Exception when user is banned #26

Closed nlybe closed 7 years ago

nlybe commented 7 years ago

If a user who is banned on Elgg tries to login using facebook, throws an exception in blue screen:

LoginException: You have been banned from this site and cannot log in in /var/www/mysite.com/vendor/elgg/elgg/engine/lib/sessions.php:322.

It should just display a warning message to user.

oseg commented 7 years ago

If you are running elgg_hybridauth v2.0.7, I had the same issue. I fixed it by encapsulating the login function by a try/catch block:

In views/default/resources/hybridauth/authenticate.php at line 138 replace login($user_to_login); by

try {
  login($user_to_login);
} catch(LoginException $e){
  register_error($e->getMessage());
  forward(REFERER);
}
oseg commented 7 years ago

fixed by a8cd2fd00ca78c4b32fa048082c773a3a816ccda