From 9f7a10bcd32b127416fafc4b441bf0794c8992d5 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Tue, 20 Jun 2023 14:11:40 -0500 Subject: [PATCH] Correct authentication for xero --- src/app/pmtservice/pmtservice.component.ts | 4 ++-- src/app/xero.service.ts | 4 ++-- src/app/xeroreg/xeroreg.component.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/pmtservice/pmtservice.component.ts b/src/app/pmtservice/pmtservice.component.ts index 5a3cba0..c357007 100644 --- a/src/app/pmtservice/pmtservice.component.ts +++ b/src/app/pmtservice/pmtservice.component.ts @@ -182,7 +182,7 @@ vE = { // console.log('received amount -> ' + reqData.amount); const ownParams = new HttpParams().append('id', reqData.ownerId); let obs = this.http.get<{message:string, owner: any}> - ( this.beUrl+'api/ownerid', + ( this.beUrl+'ownerid', { headers: this.reqHeaders, params: ownParams, observe: 'response'}); @@ -227,7 +227,7 @@ vE = { invParams = invParams.append('address', this.owner.address); invParams = invParams.append('inv', reqData.invoice); let inv = this.http.get<{message:string, invData: any}> - ( this.beUrl+'api/invdata', + ( this.beUrl+'invdata', { headers: this.reqHeaders, params: invParams, observe: 'response'}); diff --git a/src/app/xero.service.ts b/src/app/xero.service.ts index b2c1107..cc49000 100644 --- a/src/app/xero.service.ts +++ b/src/app/xero.service.ts @@ -65,8 +65,8 @@ export class XeroService { return obs; } - getXeroAccessToken(code: string, address: string){ - const params = this.reqParams.append('code', code).append('address', address); + getXeroAccessToken(code: string){ + const params = this.reqParams.append('code', code); let obs = this.http.get(this.beUrl + 'api/xerotoken' , {headers: this.reqHeaders, params: params, observe: 'response'}); return obs; } diff --git a/src/app/xeroreg/xeroreg.component.ts b/src/app/xeroreg/xeroreg.component.ts index 2984bf7..a425621 100644 --- a/src/app/xeroreg/xeroreg.component.ts +++ b/src/app/xeroreg/xeroreg.component.ts @@ -77,7 +77,7 @@ export class XeroRegComponent implements OnInit { this.activatedRoute.queryParams.subscribe((params) => { //console.log(params); if (params.state === this.owner.address.substring(0,6)) { - this.xeroService.getXeroAccessToken(params.code, this.owner.address).subscribe(tokenData => { + this.xeroService.getXeroAccessToken(params.code).subscribe(tokenData => { if (tokenData.status == 200) { //console.log(tokenData.body!); this.flag = true;