Update AuthenticationStateMachine.swift to permit XOAUTH2 Gmail connections #729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Permit connections via AUTH XOAUTH2 (for Gmail) by having the client continue on responses rather than throwing.
Motivation:
In the current version, after submitting a
AUTHENTICATE XOAUTH2
command with anInitialResponse
, the client will hang and never process its result nor continue. This change permits the client to process the response and continue with operations, which lets OAUTH connections to Gmail work.Modifications:
I have proposed making the
.untagged
case follow the.tagged
case, rather than.fatal
etc.Result:
This lets connections to Gmail imap work.
I would like to add that the motivation behind the current system is not completely understood by me and this proposed fix is no doubt not the only way to achieve a fix. I would like to draw attention to this issue (Gmail does not work with swift-nio-imap, as far as I could figure out), and provide one possible solution.