File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,18 @@ func AuthHandler(subjects []string, verifier Verifier) http.Handler {
28
28
auth := r .Header .Get ("Authorization" )
29
29
jwt , err := parseAuthHeader (auth )
30
30
if err != nil {
31
- w .WriteHeader (http .StatusForbidden )
31
+ w .WriteHeader (http .StatusUnauthorized )
32
32
_ , _ = w .Write ([]byte ("Forbidden" ))
33
- log .Info ().Err (err ).Dur ("latency" , time .Since (t )).Int ("status" , http .StatusForbidden ).Msg ("Forbidden " )
33
+ log .Info ().Err (err ).Dur ("latency" , time .Since (t )).Int ("status" , http .StatusUnauthorized ).Msg ("Unauthorized " )
34
34
return
35
35
}
36
36
37
37
token , err := verifier .Verify (r .Context (), jwt )
38
38
39
39
if err != nil {
40
- w .WriteHeader (http .StatusForbidden )
40
+ w .WriteHeader (http .StatusUnauthorized )
41
41
_ , _ = w .Write ([]byte ("Forbidden" ))
42
- log .Info ().Err (err ).Dur ("latency" , time .Since (t )).Int ("status" , http .StatusForbidden ).Msg ("Forbidden " )
42
+ log .Info ().Err (err ).Dur ("latency" , time .Since (t )).Int ("status" , http .StatusUnauthorized ).Msg ("Unauthorized " )
43
43
return
44
44
}
45
45
You can’t perform that action at this time.
0 commit comments