File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ func (a *API) authMiddleware(next http.Handler) http.Handler {
27
27
Error ("failed to authenticate" )
28
28
types .NewUnauthorizedError (err ).JSON (w )
29
29
return
30
- } else if ! strings .HasPrefix (token , "Bearer " ) {
30
+ }
31
+
32
+ if ! strings .HasPrefix (token , "Bearer " ) {
31
33
err := errors .New ("authorization header must start with Bearer " )
32
34
a .logger .WithFields (logrusFieldsFromRequest (r )).WithError (err ).
33
35
Error ("failed to authenticate" )
@@ -63,7 +65,9 @@ func (a *API) postAuthLogin(w http.ResponseWriter, r *http.Request) {
63
65
if errors .Is (err , auth .ErrInvalidPassword ) {
64
66
types .NewUnauthorizedError (err ).JSON (w )
65
67
return
66
- } else if err != nil {
68
+ }
69
+
70
+ if err != nil {
67
71
a .logger .WithFields (logrusFieldsFromRequest (r )).WithError (err ).
68
72
Error ("failed to authenticate" )
69
73
types .NewInternalServerError (err ).JSON (w )
You can’t perform that action at this time.
0 commit comments