Skip to content

Commit

Permalink
refactor: jwt_secret_key file name changed and also added a ruby scri…
Browse files Browse the repository at this point in the history
…pt to generate safe random token
  • Loading branch information
tahadostifam committed Dec 1, 2024
1 parent 4c36365 commit c49e9f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ vendor/
minio_data/*
logs/logs*.json
coverage.out*
config/jwt_secret_key.pem
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func Read() *Config {
}

// Load Jwt Secret Keys
secretData, secretErr := os.ReadFile(ConfigsDirPath() + "/jwt_secret.pem")
secretData, secretErr := os.ReadFile(ConfigsDirPath() + "/jwt_secret_key.pem")
if secretErr != nil {
panic(secretErr)
}
Expand Down
7 changes: 7 additions & 0 deletions config/generate_jwt_secret.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "securerandom"

token_length = 64

new_token = SecureRandom.base64(token_length)

puts new_token
1 change: 0 additions & 1 deletion config/jwt_secret.pem

This file was deleted.

0 comments on commit c49e9f9

Please sign in to comment.