Skip to content

Commit 97cb9a3

Browse files
committed
🔒 Don't disconnect for AuthenticationCanceled [🚧 tests]
This exception represents an intentional cancellation on the part of the client's authenticator. So the connection doesn't need to be dropped.
1 parent 34c1064 commit 97cb9a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/net/imap/sasl/authentication_exchange.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ def initialize(client, mechanism, authenticator, sasl_ir: true)
9090

9191
# Call #authenticate to execute an authentication exchange for #client
9292
# using #authenticator. Authentication failures will raise an
93-
# exception. Any exceptions other than those in RESPONSE_ERRORS will
94-
# drop the connection.
93+
# exception. Any exceptions other than AuthenticationCanceled or those
94+
# in <tt>client.response_errors</tt> will drop the connection.
9595
def authenticate
9696
client.run_command(mechanism, initial_response) { process _1 }
9797
.tap { raise AuthenticationIncomplete, _1 unless done? }
98-
rescue *client.response_errors
98+
rescue AuthenticationCanceled, *client.response_errors
9999
raise # but don't drop the connection
100100
rescue
101101
client.drop_connection

0 commit comments

Comments
 (0)