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 b8480f8 + fbfc1b7 commit 0e6ea65
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 0e6ea65

Please sign in to comment.