mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
lib/oauthutil: add a new redirect URL for oauth.rclone.org
This is for use with oauth providers which won't accept http: links.
This commit is contained in:
parent
262ba28dec
commit
25a0e7e8aa
|
@ -42,6 +42,10 @@ const (
|
||||||
// RedirectLocalhostURL is redirect to local webserver when active with localhost
|
// RedirectLocalhostURL is redirect to local webserver when active with localhost
|
||||||
RedirectLocalhostURL = "http://localhost:" + bindPort + "/"
|
RedirectLocalhostURL = "http://localhost:" + bindPort + "/"
|
||||||
|
|
||||||
|
// RedirectPublicSecureURL is a public https URL which
|
||||||
|
// redirects to the local webserver
|
||||||
|
RedirectPublicSecureURL = "https://oauth.rclone.org/"
|
||||||
|
|
||||||
// AuthResponse is a template to handle the redirect URL for oauth requests
|
// AuthResponse is a template to handle the redirect URL for oauth requests
|
||||||
AuthResponse = `<!DOCTYPE html>
|
AuthResponse = `<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
@ -380,7 +384,7 @@ func doConfig(id, name string, m configmap.Mapper, errorHandler func(*http.Reque
|
||||||
// Detect whether we should use internal web server
|
// Detect whether we should use internal web server
|
||||||
useWebServer := false
|
useWebServer := false
|
||||||
switch oauthConfig.RedirectURL {
|
switch oauthConfig.RedirectURL {
|
||||||
case RedirectURL, RedirectPublicURL, RedirectLocalhostURL:
|
case RedirectURL, RedirectPublicURL, RedirectLocalhostURL, RedirectPublicSecureURL:
|
||||||
if changed {
|
if changed {
|
||||||
fmt.Printf("Make sure your Redirect URL is set to %q in your custom config.\n", oauthConfig.RedirectURL)
|
fmt.Printf("Make sure your Redirect URL is set to %q in your custom config.\n", oauthConfig.RedirectURL)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user