Skip to content

Commit 9312d90

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 d0b3a00 commit 9312d90

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
@@ -91,12 +91,12 @@ def initialize(client, mechanism, authenticator, sasl_ir: true)
9191

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

0 commit comments

Comments
 (0)