Skip to content

Commit

Permalink
Create security.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Bulletdev authored Dec 5, 2024
1 parent 0a97345 commit 8e50451
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions security.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
func authMiddleware(next http.Handler) http.Handler {

Check failure on line 1 in security.go

View workflow job for this annotation

GitHub Actions / build

expected 'package', found 'func'
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("Authorization")
if !isValidToken(token) {
http.Error(w, "Unauthorized", http.StatusUnauthorized)
return
}
next.ServeHTTP(w, r)
})
}

0 comments on commit 8e50451

Please sign in to comment.