}
else
#endif
- if((((enabledmechs & SASL_MECH_XOAUTH2) &&
- sasl->prefmech != SASL_AUTH_DEFAULT)) || conn->xoauth2_bearer) {
+ if((enabledmechs & SASL_MECH_XOAUTH2) || conn->xoauth2_bearer) {
mech = SASL_MECH_STRING_XOAUTH2;
state1 = SASL_XOAUTH2;
sasl->authused = SASL_MECH_XOAUTH2;
/* Authentication mechanism values */
#define SASL_AUTH_NONE 0
#define SASL_AUTH_ANY ~0U
-#define SASL_AUTH_DEFAULT (SASL_AUTH_ANY & ~SASL_MECH_EXTERNAL)
+#define SASL_AUTH_DEFAULT (SASL_AUTH_ANY & \
+ ~(SASL_MECH_EXTERNAL | SASL_MECH_XOAUTH2))
/* Authentication mechanism strings */
#define SASL_MECH_STRING_LOGIN "LOGIN"