Skip to content

Commit

Permalink
Check if email is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelh78 authored and trasher committed Jul 31, 2024
1 parent fb86882 commit a45f3b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/GaletteOAuth2/Authorization/UserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,16 @@ public static function getUserData(Container $container, int $id, array $options
'.' .
self::stripAccents($nameFPart);

//check active member ?
if (!$member->isActive()) {
throw new UserAuthorizationException(_T('You are not an active member.', 'oauth2'));
}

//check email
if (!filter_var($member->email, FILTER_VALIDATE_EMAIL)) {
throw new UserAuthorizationException(_T("Sorry, you can't login. Please, add an email address to your account.", 'oauth2'));
}

//for options=
//teamonly
if (in_array('teamonly', $options, true)) {
Expand Down

0 comments on commit a45f3b4

Please sign in to comment.