artdarek / oauth-4-laravel

OAuth Service Provider for Laravel 4
684 stars 216 forks source link

Share laravel session #78

Closed jenssegers closed 6 years ago

jenssegers commented 10 years ago

I modified the code to share the Laravel session instance with the consumer instances. I also added a unit test and modified the formatting slightly to be more in line with Laravel.

samvasko commented 10 years ago

Can you split it into logical commits please. It is really confusing what is a style and what is actually a change.

jenssegers commented 10 years ago

Sorry, the main thing that has changed is this:

 -    public function createStorageInstance($storageName)
 +    public function createStorageInstance()
      {
 -        $storageClass = "\\OAuth\\Common\\Storage\\$storageName";
 -        $storage = new $storageClass();
 +        // get the laravel session instance and wrap it into a storage instance
 +        $session = App::make('session')->driver();
 +        $storage = new SymfonySession($session);
samvasko commented 10 years ago

So smooth :clap:. I wish this thing would be solved already. @artdarek Reveal thyself!

jenssegers commented 10 years ago

I ended up creating my own package: https://github.com/jenssegers/laravel-oauth

But I figured I should contribute something here :)