summary refs log tree commit diff stats
path: root/worker/imap/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/imap/worker.go')
-rw-r--r--worker/imap/worker.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index cd63c39..4d3e51c 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -85,14 +85,15 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error {
 			w.config.scheme = strings.TrimSuffix(w.config.scheme, "+oauthbearer")
 			w.config.oauthBearer.Enabled = true
 			q := u.Query()
+
+			oauth2 := &oauth2.Config{}
 			if q.Get("token_endpoint") != "" {
-				w.config.oauthBearer.OAuth2 = &oauth2.Config{
-					ClientID:     q.Get("client_id"),
-					ClientSecret: q.Get("client_secret"),
-					Scopes:       []string{q.Get("scope")},
-				}
-				w.config.oauthBearer.OAuth2.Endpoint.TokenURL = q.Get("token_endpoint")
+				oauth2.ClientID = q.Get("client_id")
+				oauth2.ClientSecret = q.Get("client_secret")
+				oauth2.Scopes = []string{q.Get("scope")}
+				oauth2.Endpoint.TokenURL = q.Get("token_endpoint")
 			}
+			w.config.oauthBearer.OAuth2 = oauth2
 		}
 
 		w.config.addr = u.Host
le='Blame the previous revision' href='/akspecs/ranger/blame/.gitignore?id=0f657d5940f38bc4f50350c16ca8d2ef01100775'>^
7324552d ^
2c4322ca ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19