~azzar1/snapd-glib-fork/glib-2-40

« back to all changes in this revision

Viewing changes to snapd-login-service/snapd-login-service.c

  • Committer: Robert Ancell
  • Date: 2016-09-03 00:19:19 UTC
  • Revision ID: git-v1:3549ad97b8ba19492eb26b92807d41678550a72d
Make snapd_client_login consistent with snapd_login (since we added snapd_login_service and this is not the normal case anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
login_result_cb (GObject *object, GAsyncResult *result, gpointer user_data)
104
104
{
105
105
    g_autoptr(LoginRequest) request = user_data;
106
 
    SnapdAuthData *auth_data;
 
106
    g_autoptr(SnapdAuthData) auth_data = NULL;
107
107
    g_autoptr(GError) error = NULL;
108
108
 
109
 
    if (!snapd_client_login_finish (request->client, result, &error)) {
 
109
    auth_data = snapd_client_login_finish (request->client, result, &error);
 
110
    if (auth_data == NULL) {
110
111
        return_error (request, error);
111
112
        return;
112
113
    }
113
114
 
114
 
    auth_data = snapd_client_get_auth_data (request->client);
115
115
    io_snapcraft_snapd_login_service_complete_login (service, request->invocation,
116
116
                                                     snapd_auth_data_get_macaroon (auth_data),
117
117
                                                     (const gchar *const *) snapd_auth_data_get_discharges (auth_data));