Skip to content

Commit

Permalink
fix: sanitize tokens for the blacklist (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
abc3 authored Jun 5, 2024
1 parent d6897df commit d0a3f61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.57
1.1.58
1 change: 1 addition & 0 deletions lib/supavisor_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ defmodule SupavisorWeb.Router do
blocklist = Application.fetch_env!(:supavisor, blocklist_key)

with ["Bearer " <> token] <- get_req_header(conn, "authorization"),
token <- Regex.replace(~r/\s|\n/, URI.decode(token), ""),
false <- token in blocklist,
{:ok, _claims} <- Supavisor.Jwt.authorize(token, secret) do
conn
Expand Down

0 comments on commit d0a3f61

Please sign in to comment.