@rivascva/dt-idl 1.1.78 → 1.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,10 +13,9 @@ import (
|
|
|
13
13
|
)
|
|
14
14
|
|
|
15
15
|
// GetAuthMiddleware returns a middleware function that authenticates all requests, except for the login endpoints.
|
|
16
|
-
// It
|
|
16
|
+
// It adds the token to the request context.
|
|
17
17
|
func GetAuthMiddleware(secret string) func(http.Handler) http.Handler {
|
|
18
|
-
|
|
19
|
-
write := write.NewWrite("ERROR", log)
|
|
18
|
+
write := write.NewWrite("ERROR", log.NewLog().With("handler", "GetAuthMiddleware"))
|
|
20
19
|
|
|
21
20
|
return func(next http.Handler) http.Handler {
|
|
22
21
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
@@ -50,7 +49,7 @@ func GetAuthMiddleware(secret string) func(http.Handler) http.Handler {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
// ContextMiddleware
|
|
52
|
+
// ContextMiddleware adds helpful information to the request context.
|
|
54
53
|
func ContextMiddleware(next http.Handler) http.Handler {
|
|
55
54
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
56
55
|
// set the path in the request context
|