update more checking error
This commit is contained in:
parent
8221183630
commit
edabaf7396
3 changed files with 17 additions and 6 deletions
|
|
@ -191,6 +191,13 @@ func (ar *AuthRouter) Route(r chi.Router) {
|
|||
return
|
||||
}
|
||||
|
||||
if userInfo["error"] != nil {
|
||||
w.Header().Add("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
json.NewEncoder(w).Encode(userInfo)
|
||||
return
|
||||
}
|
||||
|
||||
// return user info
|
||||
w.Header().Add("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(map[string]interface{}{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue