Laravel passport after deployment

42 Views Asked by At

I run a laravel App on a aws ec2 instance and use laravel passport to secure my api with Bearer tokens.

After each deployment the passport keys are gone so i added a passport:install command after every deployment.

This forces all users to Relogin.

There musst be a better solution to handle this behavior.

How can i handle a deployment without the passport:install command and without forcing all users to relogin?

A solution or a bester way

1

There are 1 best solutions below

2
patricus On

You should not need to run passport:install after your initial deployment.

The Passport keys are installed by default in storage/oauth-public.key and storage/oauth-private.key. You'll need to update your deployment script so that these files are not removed.

For a more specific answer, you'll need to add more details about your deployment method.