brefphp / laravel-bridge

Package to use Laravel on AWS Lambda with Bref
https://bref.sh/docs/frameworks/laravel.html
MIT License
319 stars 63 forks source link

When using Laravel Passport the storage is overridden to /tmp before the keys are loaded #144

Open rockfreak opened 10 months ago

rockfreak commented 10 months ago

Having migrated from bref v1 to v2 I found an edge case where if using Laravel Passport the storage area is changed to the /tmp directory by laravel bridge before the passport keys have been loaded.

This was disucssed on slack with @mnapoli.

I have solved this for now by adding the following to the AuthServiceProvider in the boot function.

Passport::loadKeysFrom('directory of keys);

georgeboot commented 10 months ago

I personally put the keys in environment variables to work around this issue.

mnapoli commented 10 months ago

Yeah this is a breaking change we figured out from v1 to v2. Ideally this should keep working out of the box, I'm not sure yet how to make that happen since we automatically move the entire storage directory to /tmp 🤔