Skip to content

Commit

Permalink
Scrutinizer Auto-Fixes
Browse files Browse the repository at this point in the history
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
  • Loading branch information
scrutinizer-auto-fixer committed May 18, 2015
1 parent e8c47be commit 30210d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/LaravelU2f.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class LaravelU2f {

protected $u2f;

public function __construct ()
public function __construct()
{
$scheme = \Request::isSecure() ? "https://" : "http://";
$this->u2f = new \u2flib_server\U2F($scheme . \Request::getHttpHost());
Expand All @@ -21,7 +21,7 @@ public function getRegisterData(User $user)

public function doRegister(User $user, $registerData, $keyData)
{
$reg = $this->u2f->doRegister( $registerData, $keyData);
$reg = $this->u2f->doRegister($registerData, $keyData);
$reg->user_id = $user->id;

return U2fKey::create((array) $reg);
Expand All @@ -48,7 +48,7 @@ public function doAuthenticate(User $user, $authData, $keyData)
'publicKey' => $reg->publicKey
])->first();

if(is_null($U2fKey)) {
if (is_null($U2fKey)) {
return false;
}

Expand Down
14 changes: 7 additions & 7 deletions src/http/Controllers/U2fController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class U2fController extends Controller
*/
protected $u2f;

public function __construct (LaravelU2f $u2f)
public function __construct(LaravelU2f $u2f)
{
$this->u2f = $u2f;
}

public function registerData ()
public function registerData()
{
list($req, $sigs) = $this->u2f->getRegisterData(\Auth::user());

Expand All @@ -29,11 +29,11 @@ public function registerData ()

}

public function register ()
public function register()
{
try {
$key = $this->u2f->doRegister(\Auth::user(), \Session::get('registerData'), json_decode(\Input::get('register')));
\Event::fire('u2f.register', ['u2fKey' => $key]);
\Event::fire('u2f.register', [ 'u2fKey' => $key ]);

return redirect('/');

Expand All @@ -43,17 +43,17 @@ public function register ()
}
}

public function authData ()
public function authData()
{
$req = $this->u2f->getAuthenticateData(\Auth::user());
$req = $this->u2f->getAuthenticateData(\Auth::user());

\Session::set('authentificationData', $req);

return view('u2f::authentification')
->with('authentificationData', $req);
}

public function auth ()
public function auth()
{
try {
$this->u2f->doAuthenticate(\Auth::user(), \Session::get('authentificationData'), json_decode(\Input::get('authentification')));
Expand Down
4 changes: 2 additions & 2 deletions src/http/Middleware/U2f.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class U2f
*/
protected $u2f;

public function __construct (LaravelU2f $u2f)
public function __construct(LaravelU2f $u2f)
{
$this->u2f = $u2f;
}
Expand All @@ -28,7 +28,7 @@ public function __construct (LaravelU2f $u2f)
public function handle($request, Closure $next)
{

if(!$this->u2f->check()) {
if (!$this->u2f->check()) {
return redirect('u2f/auth');
}

Expand Down

0 comments on commit 30210d0

Please sign in to comment.