omniphx / forrest

A Laravel library for Salesforce
https://omniphx.github.io/forrest/
MIT License
259 stars 120 forks source link

Session store not set on request #259

Open guypeled1 opened 4 years ago

guypeled1 commented 4 years ago

I am getting this error when trying to authenticate. What should i do?

RipleWare commented 4 years ago

I am getting this error too after trying to use this library for the first time. I have invested a lot of time trying to get this working on a skeleton Laravel installation and I still can't get this to work.

I have tried changing the storage type, authentication method and also wrapped my authentication route in the web middleware but I still get can't get authentication to happen.

If I use the middleware, I get the following error: ErrorException: Undefined index: instance_url in file /home/vagrant/Code/ehl/vendor/omniphx/forrest/src/Omniphx/Forrest/Repositories/InstanceURLRepository.php on line 50

If I don't use middleware, I get: RuntimeException: Session store not set on request. in file /home/vagrant/Code/ehl/vendor/laravel/framework/src/Illuminate/Http/Request.php on line 483

Can anyone shed any light on this. I really want to get this library working.

mokchend commented 4 years ago

I was struggling with this error when try to use from Laravel command line. Please check: https://stackoverflow.com/questions/28866821/call-laravel-controller-via-command-line for a seamless solution.

Mushood commented 2 years ago

If you are running this in a command, change you storage.type config in config/forrest.php from session to cache

    'storage'        => [
        'type'          => 'cache', // Options include: 'session', 'cache', 'object'
        'path'          => 'forrest_', // unique storage path to avoid collisions
        'expire_in'     => 60, // number of minutes to expire cache/session
        'store_forever' => false, // never expire cache/session
    ],
shsaqib99 commented 1 year ago

@Mushood

What if i don't want the Authentication to be expired untill the user revoke it himself. should i give no value in expire_in and make store_forever : true ?