File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,24 @@ type ReAuthCredentialsListener struct {
14
14
// It calls the reAuth function with the new credentials.
15
15
// If the reAuth function returns an error, it calls the onErr function with the error.
16
16
func (c * ReAuthCredentialsListener ) OnNext (credentials Credentials ) {
17
- if c .reAuth ! = nil {
18
- err := c . reAuth ( credentials )
19
- if err != nil {
20
- if c . onErr != nil {
21
- c . onErr ( err )
22
- }
23
- }
17
+ if c .reAuth = = nil {
18
+ return
19
+ }
20
+
21
+ err := c . reAuth ( credentials )
22
+ if err != nil {
23
+ c . OnError ( err )
24
24
}
25
25
}
26
26
27
27
// OnError is called when an error occurs.
28
28
// It can be called from both the credentials provider and the reAuth function.
29
29
func (c * ReAuthCredentialsListener ) OnError (err error ) {
30
- if c .onErr ! = nil {
31
- c . onErr ( err )
30
+ if c .onErr = = nil {
31
+ return
32
32
}
33
+
34
+ c .onErr (err )
33
35
}
34
36
35
37
// NewReAuthCredentialsListener creates a new ReAuthCredentialsListener.
You can’t perform that action at this time.
0 commit comments