mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
oauthutil: make sure auth server always finishes even when things go wrong
This commit is contained in:
parent
ed91d6b5a5
commit
413faa99cf
@ -428,17 +428,18 @@ func (s *authServer) Start() {
|
||||
fs.Debugf(nil, "Successfully got code")
|
||||
if s.code != nil {
|
||||
fmt.Fprintf(w, "<h1>Success</h1>\n<p>Go back to rclone to continue</p>")
|
||||
s.code <- code
|
||||
} else {
|
||||
fmt.Fprintf(w, "<h1>Success</h1>\n<p>Cut and paste this code into rclone: <code>%s</code></p>", code)
|
||||
}
|
||||
}
|
||||
return
|
||||
} else {
|
||||
fs.Debugf(nil, "No code found on request")
|
||||
w.WriteHeader(500)
|
||||
fmt.Fprintf(w, "<h1>Failed!</h1>\nNo code found returned by remote server.")
|
||||
}
|
||||
if s.code != nil {
|
||||
s.code <- code
|
||||
}
|
||||
fs.Debugf(nil, "No code found on request")
|
||||
w.WriteHeader(500)
|
||||
fmt.Fprintf(w, "<h1>Failed!</h1>\nNo code found returned by remote server.")
|
||||
|
||||
})
|
||||
|
||||
var err error
|
||||
|
Loading…
Reference in New Issue
Block a user