static int pakfire_client_auth_response(struct pakfire_xfer* xfer,
pakfire_xfer_error_code_t code, json_object* response, void* data);
+static int pakfire_client_auth_required(struct pakfire_client* self);
+
/*
Triggers a refresh of the access and refresh tokens
*/
if (!*self->auth.refresh_token)
return -ENOTSUP;
+ // Require authentication if the refresh token has completely expired
+ if (pakfire_jwt_has_expired(self->auth.refresh_token))
+ return pakfire_client_auth_required(self);
+
// Log action
DEBUG(self->ctx, "Refreshing authentication tokens...\n");