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; + } +}