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 {
1414// It calls the reAuth function with the new credentials.
1515// If the reAuth function returns an error, it calls the onErr function with the error.
1616func (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 )
2424 }
2525}
2626
2727// OnError is called when an error occurs.
2828// It can be called from both the credentials provider and the reAuth function.
2929func (c * ReAuthCredentialsListener ) OnError (err error ) {
30- if c .onErr ! = nil {
31- c . onErr ( err )
30+ if c .onErr = = nil {
31+ return
3232 }
33+
34+ c .onErr (err )
3335}
3436
3537// NewReAuthCredentialsListener creates a new ReAuthCredentialsListener.
You can’t perform that action at this time.
0 commit comments