]> git.ipfire.org Git - pakfire.git/commitdiff
client: Log an error when we want to use authentication without being authenticated
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Jun 2025 17:01:06 +0000 (17:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Jun 2025 17:01:06 +0000 (17:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/client.c

index 6925279c498b4ef68ea93237eaad93f84a435470..deeb948df6d380e6aeca9edad694ffac3eaa9770 100644 (file)
@@ -170,8 +170,10 @@ static int pakfire_client_xfer_auth(struct pakfire_client* self, struct pakfire_
        int r;
 
        // Fail if not authenticated
-       if (!*self->auth.access_token)
+       if (!*self->auth.access_token) {
+               ERROR(self->ctx, "Authentication requested, but the client is not authenticated\n");
                return -ENOTSUP;
+       }
 
        // Set the access token
        r = pakfire_xfer_add_header(xfer, "Authorization: Bearer %s", self->auth.access_token);