diff --git a/backend/src/admin/admin.service.ts b/backend/src/admin/admin.service.ts index cd69244d..889084f7 100644 --- a/backend/src/admin/admin.service.ts +++ b/backend/src/admin/admin.service.ts @@ -256,12 +256,10 @@ export class AdminService { async removeAdmin(username: string): Promise<{ error: string | null }> { const ticdiAdminRole = 'ticdi_admin'; const bearerToken = await this.getToken(); - const url = new URL( - `${process.env.users_api_base_url}/integrations/${process.env.integration_id}/${process.env.css_environment}/users/${username}@idir/roles/${ticdiAdminRole}` - ); + const url = `${process.env.users_api_base_url}/integrations/${process.env.integration_id}/${process.env.css_environment}/users/${username}@idir/roles/${ticdiAdminRole}`; try { await axios - .delete(url.href, { + .delete(url, { headers: { Authorization: 'Bearer ' + bearerToken }, }) .then((res) => {