Skip to content

Commit

Permalink
Refactor JWT secret and audience retrieval to use JwtSecrets module.
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho committed Oct 6, 2024
1 parent 7697a01 commit 8d62579
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/Note.fs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ let login: HttpHandler =
let passwordMatches = Auth.validatePassword password hash
// check if user is admin
let role = if user.IsSuperuser then "admin" else "user"

let jwtKey = Util.getEnvVar "JWT_SECRET"
let audience = Util.getEnvVar "JWT_AUDIENCE"
let jwtAudienceName = "logbook"
let secret = JwtSecrets.GetJwtSecret conn jwtAudienceName
let jwtKey = secret.Secret
let audience = secret.Audience
let issuer = "logbook-swuecho.github.com"

if passwordMatches then
Expand Down

0 comments on commit 8d62579

Please sign in to comment.