Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Cosgrove committed Dec 6, 2017
2 parents 3167a6c + 9e3b997 commit 06acf28
Show file tree
Hide file tree
Showing 141 changed files with 260 additions and 18,337 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v1.4.0
## 12/06/2017

1. [](#bugfix)
* Compatibility fixes with Login plugin v2.5.0 - Messages system
1. [](#improved)
* Updated OAuth library to v0.8.10 [#14](https://github.com/getgrav/grav-plugin-login-oauth/issues/14)

# v1.3.1
## 09/12/2017

Expand All @@ -11,7 +19,7 @@
* Added Blacklist and Whitelist support to Google

# v1.2.0
## 12/18/2017
## 1/18/2017

1. [](#new)
* Added LinkedIn provider [#11](https://github.com/getgrav/grav-plugin-login-oauth/pull/11)
Expand Down
4 changes: 2 additions & 2 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Login Plugin OAuth Addon
version: 1.3.1
version: 1.4.0
description: Enables login with OAuth accounts. Currently provides Facebook, Google, Twitter, Github, Linkedin
icon: sign-in
author:
Expand All @@ -12,7 +12,7 @@ bugs: https://github.com/getgrav/grav-plugin-login-oauth/issues
license: MIT

dependencies:
- { name: login, version: '>=2.4.1' }
- { name: login, version: '>=2.5.0' }

form:
validation: loose
Expand Down
14 changes: 8 additions & 6 deletions classes/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function execute()
{
/** @var \Grav\Common\Language\Language */
$t = $this->grav['language'];
$messages = $this->grav['messages'];
$provider = strtolower($this->action);
$config = $this->grav['config']->get('plugins.login-oauth.providers.' . $this->action, []);

Expand All @@ -95,7 +96,7 @@ public function execute()
$this->service = $this->factory->createService($this->action, $credentials, $this->storage, $scope);
}
if (!$this->service || empty($config)) {
$this->login->setMessage($t->translate(['PLUGIN_LOGIN_OAUTH.OAUTH_PROVIDER_NOT_SUPPORTED', $this->action]));
$messages->add($t->translate(['PLUGIN_LOGIN_OAUTH.OAUTH_PROVIDER_NOT_SUPPORTED', $this->action]));

return true;
}
Expand All @@ -106,9 +107,9 @@ public function execute()
if (is_bool($authenticated)) {
$this->reset();
if ($authenticated) {
$this->login->setMessage($t->translate('PLUGIN_LOGIN.LOGIN_SUCCESSFUL'));
$messages->add($t->translate('PLUGIN_LOGIN.LOGIN_SUCCESSFUL'));
} else {
$this->login->setMessage($t->translate('PLUGIN_LOGIN.ACCESS_DENIED'));
$messages->add($t->translate('PLUGIN_LOGIN.ACCESS_DENIED'));
}

// Redirect to current URI
Expand All @@ -118,7 +119,7 @@ public function execute()
}
$this->setRedirect($redirect);
} elseif (!$this->grav['session']->oauth) {
$this->login->setMessage($t->translate(['PLUGIN_LOGIN_OAUTH.OAUTH_PROVIDER_NOT_SUPPORTED', $this->action]));
$messages->add($t->translate(['PLUGIN_LOGIN_OAUTH.OAUTH_PROVIDER_NOT_SUPPORTED', $this->action]));
}

return true;
Expand Down Expand Up @@ -241,6 +242,7 @@ public function oauthGoogle()
return $this->genericOAuthProvider(function () {
/** @var \Grav\Common\Language\Language */
$t = $this->grav['language'];
$messages = $this->grav['messages'];

// Get fullname, email and language
$data = json_decode($this->service->request('userinfo'), true);
Expand All @@ -251,7 +253,7 @@ public function oauthGoogle()
$domain = isset($data['hd'])?$data['hd']:'gmail.com';

if ( !in_array($domain, $whitelist) ) {
$this->login->setMessage($t->translate(['PLUGIN_LOGIN_OAUTH.EMAIL_DOMAIN_NOT_PERMITTED', $domain]));
$messages->add($t->translate(['PLUGIN_LOGIN_OAUTH.EMAIL_DOMAIN_NOT_PERMITTED', $domain]));
return null;
}
}
Expand All @@ -261,7 +263,7 @@ public function oauthGoogle()
$domain = isset($data['hd'])?$data['hd']:'gmail.com';

if( in_array($domain, $blacklist)) {
$this->login->setMessage($t->translate(['PLUGIN_LOGIN_OAUTH.EMAIL_DOMAIN_NOT_PERMITTED', $domain]));
$messages->add($t->translate(['PLUGIN_LOGIN_OAUTH.EMAIL_DOMAIN_NOT_PERMITTED', $domain]));
return null;
}
}
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,13 @@ private function findFileWithExtension($class, $ext)

$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
if (0 === strpos($class, $prefix)) {
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\';
if (isset($this->prefixDirsPsr4[$search])) {
foreach ($this->prefixDirsPsr4[$search] as $dir) {
$length = $this->prefixLengthsPsr4[$first][$search];
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
return $file;
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Copyright (c) 2016 Nils Adermann, Jordi Boggiano
Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[
{
"name": "lusitanian/oauth",
"version": "v0.8.9",
"version_normalized": "0.8.9.0",
"version": "v0.8.10",
"version_normalized": "0.8.10.0",
"source": {
"type": "git",
"url": "https://github.com/Lusitanian/PHPoAuthLib.git",
"reference": "29bda6e176df6c292a9b1c43ae8a44d56a87c30b"
"reference": "09f4af38f17db6938253f4d1b171d537913ac1ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/29bda6e176df6c292a9b1c43ae8a44d56a87c30b",
"reference": "29bda6e176df6c292a9b1c43ae8a44d56a87c30b",
"url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/09f4af38f17db6938253f4d1b171d537913ac1ed",
"reference": "09f4af38f17db6938253f4d1b171d537913ac1ed",
"shasum": ""
},
"require": {
Expand All @@ -28,7 +28,7 @@
"predis/predis": "Allows using the Redis storage backend.",
"symfony/http-foundation": "Allows using the Symfony Session storage backend."
},
"time": "2016-02-24T00:20:18+00:00",
"time": "2016-07-12T22:15:40+00:00",
"type": "library",
"extra": {
"branch-alias": {
Expand Down
6 changes: 0 additions & 6 deletions vendor/lusitanian/oauth/.gitignore

This file was deleted.

37 changes: 0 additions & 37 deletions vendor/lusitanian/oauth/.scrutinizer.yml

This file was deleted.

22 changes: 0 additions & 22 deletions vendor/lusitanian/oauth/.travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions vendor/lusitanian/oauth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Included service implementations
- LinkedIn
- Mailchimp
- Microsoft
- Mondo
- Nest
- Netatmo
- Parrot Flower Power
Expand Down Expand Up @@ -113,6 +114,7 @@ Framework Integration
---------------------
* Lithium: Sébastien Charrier has written [an adapter](https://github.com/scharrier/li3_socialauth) for the library.
* Laravel 4: Dariusz Prząda has written [a service provider](https://github.com/artdarek/oauth-4-laravel) for the library.
* Laravel 5: Valentin Ivaşcu ported Dariusz Prząda's Laravel 4 library to [Laravel 5](https://github.com/oriceon/oauth-5-laravel).
* Symfony: Alexander Pinnecke has written [a Symfony Bundle](https://github.com/apinnecke/OAuthBundle) for the library.

Extensions
Expand Down
52 changes: 0 additions & 52 deletions vendor/lusitanian/oauth/examples/amazon.php

This file was deleted.

64 changes: 0 additions & 64 deletions vendor/lusitanian/oauth/examples/bitbucket.php

This file was deleted.

Loading

0 comments on commit 06acf28

Please sign in to comment.