about 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
&id=79b459ecb0da7759de617d164cb1cafc4a6be1c8'>^
455c6f0 ^
f5bf4a9 ^
455c6f0 ^
acfe7d7 ^
f5bf4a9 ^
10a3d9d ^

11a569f ^



6c03596 ^
f5bf4a9 ^

67ddaea ^
04d9ab3 ^

91a75cd ^
f81e4bd ^
91a75cd ^


5d0402a ^
04d9ab3 ^

0ec970b ^
0494c9a ^



6353897 ^



0494c9a ^

0897413 ^

0494c9a ^

04d9ab3 ^
577248f ^
f77d7c2 ^

702ad43 ^
f77d7c2 ^





577248f ^
687f1d8 ^
577248f ^




f77d7c2 ^



887ff65 ^
52b3181 ^
8b2abcb ^
f77d7c2 ^
04d9ab3 ^

687f1d8 ^
04d9ab3 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99