Handle Facebook not providing an email address
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 30 Jun 2021 10:57:11 +0000 (12:57 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 30 Jun 2021 10:57:11 +0000 (12:57 +0200)
Fixes #4241

wcfsetup/install/files/lib/action/FacebookAuthAction.class.php

index 901a855584592b3ba77a398f9413c74f9ad76bea..c5276b384699bc43568fbea6a15335597a4cf57b 100644 (file)
@@ -106,7 +106,9 @@ final class FacebookAuthAction extends AbstractOauth2Action
 
         $parsed['__id'] = $parsed['id'];
         $parsed['__username'] = $parsed['name'];
-        $parsed['__email'] = $parsed['email'];
+        if (!empty($parsed['email'])) {
+            $parsed['__email'] = $parsed['email'];
+        }
         $parsed['accessToken'] = $accessToken;
 
         return new OauthUser($parsed);