Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to newest namshi/jose. Dropped support for PHP 5.3 #110

Merged
merged 2 commits into from
Nov 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
Expand Down
9 changes: 5 additions & 4 deletions Encoder/JWTEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace Lexik\Bundle\JWTAuthenticationBundle\Encoder;

use Namshi\JOSE\JWS;
use InvalidArgumentException;
use Namshi\JOSE\SimpleJWS;

/**
* JWTEncoder
Expand Down Expand Up @@ -45,7 +46,7 @@ public function __construct($privateKey, $publicKey, $passPhrase)
*/
public function encode(array $data)
{
$jws = new JWS(self::ALGORYTHM);
$jws = new SimpleJWS(array('alg' => self::ALGORYTHM));
$jws->setPayload($data);
$jws->sign($this->getPrivateKey());

Expand All @@ -58,8 +59,8 @@ public function encode(array $data)
public function decode($token)
{
try {
$jws = JWS::load($token);
} catch (\InvalidArgumentException $e) {
$jws = SimpleJWS::load($token);
} catch (InvalidArgumentException $e) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
}
],
"require": {
"php": ">=5.3.3",
"php": ">=5.4.8",
"symfony/symfony": "~2.3",
"symfony/framework-bundle": "~2.3",
"namshi/jose": "~2.2"
"namshi/jose": "~6.0"
},
"suggest": {
"gesdinet/jwt-refresh-token-bundle": "Implements a refresh token system over Json Web Tokens in Symfony"
Expand Down