Skip to content

Commit

Permalink
Fix JWT setup for Heroku deployment
Browse files Browse the repository at this point in the history
Issue is that JWT keys cannot be store on the filesystem.
Proposal is to read them from ENV.
  • Loading branch information
bjrbhre committed Mar 20, 2019
1 parent 4471923 commit 17ff487
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions api/.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ CORS_ALLOW_ORIGIN=^https?://localhost(:[0-9]+)?$
VARNISH_URL=http://cache-proxy

###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=e9503436f63f37f6381616b3e8080536
# JWT_PRIVATE_KEY=$(cat %kernel.project_dir%/config/jwt/private.pem | base64 | tr -d '\n')
# JWT_PUBLIC_KEY=$(cat %kernel.project_dir%/config/jwt/public.pem | base64 | tr -d '\n')
# JWT_PASSPHRASE=!ChangeMe!
###< lexik/jwt-authentication-bundle ###

###> symfony/swiftmailer-bundle ###
Expand Down
4 changes: 2 additions & 2 deletions api/config/packages/lexik_jwt_authentication.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lexik_jwt_authentication:
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
secret_key: '%env(base64:JWT_PRIVATE_KEY)%'
public_key: '%env(base64:JWT_PUBLIC_KEY)%'
pass_phrase: '%env(JWT_PASSPHRASE)%'

0 comments on commit 17ff487

Please sign in to comment.