Skip to content

Commit

Permalink
Merge branch 'master' into DecodeJwt-Unit-Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoaibdev7 authored Dec 6, 2024
2 parents 23fdc95 + 9e53e3a commit 5bb7392
Show file tree
Hide file tree
Showing 3 changed files with 564 additions and 0 deletions.
6 changes: 6 additions & 0 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ func PubKeyContext(next http.Handler) http.Handler {
// PubKeyContext parses pukey from signed timestamp
func PubKeyContextSuperAdmin(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

if r == nil {
http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
return
}

token := r.URL.Query().Get("token")
if token == "" {
token = r.Header.Get("x-jwt")
Expand Down
Loading

0 comments on commit 5bb7392

Please sign in to comment.