Skip to content

Commit

Permalink
Merge pull request #57 from NJUPT-SAST/dev-xun
Browse files Browse the repository at this point in the history
add log
  • Loading branch information
Xunop authored Oct 25, 2023
2 parents 4128e1c + a4657c8 commit 64be5a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/v1/oauth_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func userAuthorizeHandler(w http.ResponseWriter, r *http.Request) (userID string

w.Header().Set("Content-Type", "application/json")
response := result.Failed(result.TokenError)
log.Println("Oauth2: token is empty")
json, _ := json.Marshal(response)
w.Write(json)
return
Expand All @@ -302,6 +303,7 @@ func userAuthorizeHandler(w http.ResponseWriter, r *http.Request) (userID string

w.Header().Set("Content-Type", "application/json")
response := result.Failed(result.TokenError)
log.Println("Oauth2: token is invalid")
json, _ := json.Marshal(response)
w.Write(json)
return
Expand All @@ -318,6 +320,7 @@ func userAuthorizeHandler(w http.ResponseWriter, r *http.Request) (userID string

w.Header().Set("Content-Type", "application/json")
response := result.Failed(result.TokenError)
log.Println("Oauth2: token is invalid")
json, _ := json.Marshal(response)
w.Write(json)
return
Expand All @@ -332,6 +335,7 @@ func userAuthorizeHandler(w http.ResponseWriter, r *http.Request) (userID string

w.Header().Set("Content-Type", "application/json")
response := result.Failed(result.TokenError)
log.Println("Oauth2: token is invalid")
json, _ := json.Marshal(response)
w.Write(json)
return
Expand Down

0 comments on commit 64be5a8

Please sign in to comment.