We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a97345 commit 8e50451Copy full SHA for 8e50451
security.go
@@ -0,0 +1,10 @@
1
+func authMiddleware(next http.Handler) http.Handler {
2
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
3
+ token := r.Header.Get("Authorization")
4
+ if !isValidToken(token) {
5
+ http.Error(w, "Unauthorized", http.StatusUnauthorized)
6
+ return
7
+ }
8
+ next.ServeHTTP(w, r)
9
+ })
10
+}
0 commit comments