Correct authentication for xero

This commit is contained in:
Rene Vergara 2023-06-20 14:11:40 -05:00
parent c9bf50170d
commit 9f7a10bcd3
Signed by: pitmutt
GPG Key ID: 65122AD495A7F5B2
3 changed files with 5 additions and 5 deletions

View File

@ -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'});

View File

@ -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;
}

View File

@ -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;