mirror of
https://github.com/rclone/rclone.git
synced 2024-12-15 11:41:43 +01:00
lib/oauthutil: return error messages from the oauth process better
This commit is contained in:
parent
6ade1055d5
commit
704217b698
@ -813,10 +813,17 @@ func (s *authServer) handleAuth(w http.ResponseWriter, req *http.Request) {
|
|||||||
// get code, error if empty
|
// get code, error if empty
|
||||||
code := req.Form.Get("code")
|
code := req.Form.Get("code")
|
||||||
if code == "" {
|
if code == "" {
|
||||||
reply(http.StatusBadRequest, &AuthResult{
|
err := &AuthResult{
|
||||||
Name: "Auth Error",
|
Name: "Auth Error",
|
||||||
Description: "No code returned by remote server",
|
Description: "No code returned by remote server",
|
||||||
})
|
}
|
||||||
|
if errorCode := req.Form.Get("error"); errorCode != "" {
|
||||||
|
err.Description += ": " + errorCode
|
||||||
|
}
|
||||||
|
if errorMessage := req.Form.Get("error_description"); errorMessage != "" {
|
||||||
|
err.Description += ": " + errorMessage
|
||||||
|
}
|
||||||
|
reply(http.StatusBadRequest, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user