mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-12 20:03:24 +00:00
fix: Send signature and message in publishService body
The auth middleware expects username, signature, and message in the request body for POST requests. The service object already contains signature and message from rondevu.ts, so we just need to ensure they're sent by spreading the service object and adding username.
This commit is contained in:
@@ -398,14 +398,15 @@ export class RondevuAPI {
|
||||
* Service FQN must include username: service:version@username
|
||||
*/
|
||||
async publishService(service: ServiceRequest): Promise<Service> {
|
||||
const auth = await this.generateAuthParams('publishService', service.serviceFqn);
|
||||
|
||||
const response = await fetch(`${this.baseUrl}/services`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ ...service, username: auth.username }),
|
||||
body: JSON.stringify({
|
||||
...service,
|
||||
username: this.username
|
||||
}),
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user