From ac644c4022382a219d86c403061df017d867a71e Mon Sep 17 00:00:00 2001 From: Iben Van de Veire Date: Mon, 19 May 2025 14:11:55 +0200 Subject: [PATCH 1/2] fix(ngx-auth): Correctly implement the body parameter of POST, PUSH and PATCH --- .../authenticated-http-client.service.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libs/angular/authentication/src/lib/services/authenticated-http-client/authenticated-http-client.service.ts b/libs/angular/authentication/src/lib/services/authenticated-http-client/authenticated-http-client.service.ts index dae5c9dc..c1f96622 100644 --- a/libs/angular/authentication/src/lib/services/authenticated-http-client/authenticated-http-client.service.ts +++ b/libs/angular/authentication/src/lib/services/authenticated-http-client/authenticated-http-client.service.ts @@ -112,19 +112,22 @@ export class NgxAuthenticatedHttpClient { * Constructs a POST request to the provided API * * @param url - The url of the API + * @param body - The body we wish to send * @param params - An optional set of params we wish to send to the API * @param withCredentials - Whether the call is made by an authenticated user, by default true * @param context - An optional HTTPContext */ public post( url: string, + body: any, params?: Parameters[1]['params'], withCredentials: boolean = true, context?: HttpContext ): Observable { return this.httpClient.post( this.handleUrl(url), - clean({ params, withCredentials, context }) as Parameters[1] + body, + clean({ params, withCredentials, context }) as Parameters[2] ); } @@ -132,19 +135,22 @@ export class NgxAuthenticatedHttpClient { * Constructs a PUT request to the provided API * * @param url - The url of the API + * @param body - The body we wish to send * @param params - An optional set of params we wish to send to the API * @param withCredentials - Whether the call is made by an authenticated user, by default true * @param context - An optional HTTPContext */ public put( url: string, + body?: any, params?: Parameters[1]['params'], withCredentials: boolean = true, context?: HttpContext ): Observable { return this.httpClient.put( this.handleUrl(url), - clean({ params, withCredentials, context }) as Parameters[1] + body, + clean({ params, withCredentials, context }) as Parameters[2] ); } @@ -152,19 +158,22 @@ export class NgxAuthenticatedHttpClient { * Constructs a PATCH request to the provided API * * @param url - The url of the API + * @param body - The body we wish to send * @param params - An optional set of params we wish to send to the API * @param withCredentials - Whether the call is made by an authenticated user, by default true * @param context - An optional HTTPContext */ public patch( url: string, + body: any, params?: Parameters[1]['params'], withCredentials: boolean = true, context?: HttpContext ): Observable { return this.httpClient.patch( this.handleUrl(url), - clean({ params, withCredentials, context }) as Parameters[1] + body, + clean({ params, withCredentials, context }) as Parameters[2] ); } } From 7e5bc9698ef117f7eef06fa368a31f8ac482994f Mon Sep 17 00:00:00 2001 From: Iben Van de Veire Date: Mon, 19 May 2025 14:12:11 +0200 Subject: [PATCH 2/2] build(ngx-auth):v19.0.2 --- libs/angular/authentication/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/angular/authentication/package.json b/libs/angular/authentication/package.json index f2f9ff01..0b8430d9 100644 --- a/libs/angular/authentication/package.json +++ b/libs/angular/authentication/package.json @@ -1,6 +1,6 @@ { "name": "@studiohyperdrive/ngx-auth", - "version": "19.0.1", + "version": "19.0.2", "description": "A library of core authentication functionality used with @studiohyperdrive/types-auth.", "keywords": [ "angular",