From 26aa1b3654cab66d91e0ada194be547e790a847b Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 23 Aug 2012 15:02:10 +0200 Subject: [PATCH] UOA auth: Wait for callback when requesting password signon_auth_session_process() does not keep its own ref on the session object, so freeing the AuthContext before callback cancels the call. https://bugzilla.gnome.org/show_bug.cgi?id=680776 --- libempathy/empathy-uoa-auth-handler.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/libempathy/empathy-uoa-auth-handler.c b/libempathy/empathy-uoa-auth-handler.c index ee377349..16d664fb 100644 --- a/libempathy/empathy-uoa-auth-handler.c +++ b/libempathy/empathy-uoa-auth-handler.c @@ -138,6 +138,23 @@ auth_context_done (AuthContext *ctx) auth_context_free (ctx); } +static void +request_password_session_process_cb (SignonAuthSession *session, + GHashTable *session_data, + const GError *error, + gpointer user_data) +{ + AuthContext *ctx = user_data; + + if (error != NULL) + { + DEBUG ("Error processing the session to request user's attention: %s", + error->message); + } + + auth_context_done (ctx); +} + static void auth_cb (GObject *source, GAsyncResult *result, @@ -166,16 +183,15 @@ auth_cb (GObject *source, signon_auth_session_process (ctx->session, ag_auth_data_get_parameters (ctx->auth_data), ag_auth_data_get_mechanism (ctx->auth_data), - NULL, NULL); + request_password_session_process_cb, ctx); g_hash_table_unref (extra_params); } else { DEBUG ("Auth on %s suceeded", tp_proxy_get_object_path (channel)); + auth_context_done (ctx); } - - auth_context_done (ctx); } static void -- 2.39.2