From fffe53c97dc9698d747f56fc0a78222548d0076b Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 19 Apr 2018 16:51:25 +0200 Subject: [PATCH] adding app/library/OAuth/UserData/Google.php --- app/library/OAuth/UserData/Google.php | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 app/library/OAuth/UserData/Google.php diff --git a/app/library/OAuth/UserData/Google.php b/app/library/OAuth/UserData/Google.php new file mode 100644 index 0000000..86a80ab --- /dev/null +++ b/app/library/OAuth/UserData/Google.php @@ -0,0 +1,59 @@ +data = $data; + } + + /** + * {@inheritDoc} + */ + public function getProvider() + { + return 'Google'; + } + + /** + * {@inheritDoc} + */ + public function getId() + { + return (int) $this->data['id']; + } + + /** + * {@inheritDoc} + */ + public function getUsername() + { + return null; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + return $this->data['displayName']; + } + + /** + * {@inheritDoc} + */ + public function getEmail() + { + if (isset($this->data['emails'][0]['value'])) { + return $this->data['emails'][0]['value']; + } + return null; + } +}