Skip to content

Commit

Permalink
⚡️No longer mandatory to provide a JWT secret key.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Mar 31, 2024
1 parent 9c87328 commit 08657cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/database/src/functions/frontend/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct Keys {
}

static JWT_SECRET: Lazy<Keys> = Lazy::new(|| {
let str = std::env::var("JWT_SECRET").expect("JWT_SECRET must be set");
let str = std::env::var("JWT_SECRET").unwrap_or(uuid::Uuid::new_v4().to_string());
Keys {
encoding: EncodingKey::from_secret(str.as_bytes()),
decoding: DecodingKey::from_secret(str.as_bytes()),
Expand Down

0 comments on commit 08657cf

Please sign in to comment.