Allow configurable audience claim (#975)

This commit is contained in:
Elliot Murphy
2017-09-26 07:29:20 -07:00
committed by Joe Nelson
parent 4ba27d84a4
commit 3ccae4bb8b
10 changed files with 82 additions and 15 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ postgrest conf refDbStructure pool worker =
response <- case userApiRequest (configSchema conf) req body of
Left err -> return $ apiRequestError err
Right apiRequest -> do
eClaims <- jwtClaims jwtSecret (toS $ iJWT apiRequest)
eClaims <- jwtClaims jwtSecret (configJwtAudience conf) (toS $ iJWT apiRequest)
let authed = containsRole eClaims
handleReq = runWithClaims conf eClaims (app dbStructure conf) apiRequest