Skip to content

Commit

Permalink
fix: use env variable to set jwt secret
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Dec 25, 2024
1 parent 554e84c commit 6a4ea80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/backend_ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
FRONTEND_URL: http://localhost:4000/sub-path
FRONTEND_API_SECRET: SECRET
SECRET_KEY_BASE: SECRET
JWT_SECRET: SECRET

services:
postgres:
Expand Down
1 change: 1 addition & 0 deletions backend/.env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# RAILS APP
SECRET_KEY_BASE=
JWT_SECRET=
BACKEND_URL=http://localhost:4000/sub-path/backend
RAILS_RELATIVE_URL_ROOT=/sub-path/backend

Expand Down
2 changes: 1 addition & 1 deletion backend/app/services/jwt_auth.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class JWTAuth
ALGORITHM = "HS256".freeze
SECRET = Rails.application.secrets.secret_key_base
SECRET = ENV["JWT_SECRET"]

def self.encode(member)
payload = {
Expand Down

0 comments on commit 6a4ea80

Please sign in to comment.