Commit f5d465d8 authored by John Brooks's avatar John Brooks

[telepathy-sasl-signon] Only trigger CredentialsNeedUpdate for specific SASL errors

Unfortunately, telepathy's AuthenticationFailed error arrives for many
normal cases, like a connection reset during authentication. We cannot
invalidate credentials indiscriminately.

Instead, watch for the two specific wocky errors that indicate the
server probably rejected our credentials and signal only for those.
parent 057112d1
......@@ -200,9 +200,22 @@ auth_cb (GObject *source,
if (!empathy_sasl_auth_finish (channel, result, &error))
{
DEBUG ("SASL Mechanism error: %s", error->message);
g_clear_error (&error);
request_password (ctx);
// If the error looks like credential failure, set the CredentialsNeedUpdate flag.
// We cannot set the flag for all SASL errors, because this includes things like a
// connection reset during authentication.
if (strstr(error->message, "WOCKY_AUTH_ERROR_FAILURE") ||
strstr(error->message, "WOCKY_AUTH_ERROR_NOT_AUTHORIZED"))
{
request_password (ctx);
}
else
{
DEBUG ("Auth on %s failed", tp_proxy_get_object_path (channel));
auth_context_done (ctx);
}
g_clear_error (&error);
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment