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); // console.log('received amount -> ' + reqData.amount);
const ownParams = new HttpParams().append('id', reqData.ownerId); const ownParams = new HttpParams().append('id', reqData.ownerId);
let obs = this.http.get<{message:string, owner: any}> let obs = this.http.get<{message:string, owner: any}>
( this.beUrl+'api/ownerid', ( this.beUrl+'ownerid',
{ headers: this.reqHeaders, { headers: this.reqHeaders,
params: ownParams, params: ownParams,
observe: 'response'}); observe: 'response'});
@ -227,7 +227,7 @@ vE = {
invParams = invParams.append('address', this.owner.address); invParams = invParams.append('address', this.owner.address);
invParams = invParams.append('inv', reqData.invoice); invParams = invParams.append('inv', reqData.invoice);
let inv = this.http.get<{message:string, invData: any}> let inv = this.http.get<{message:string, invData: any}>
( this.beUrl+'api/invdata', ( this.beUrl+'invdata',
{ headers: this.reqHeaders, { headers: this.reqHeaders,
params: invParams, params: invParams,
observe: 'response'}); observe: 'response'});

View file

@ -65,8 +65,8 @@ export class XeroService {
return obs; return obs;
} }
getXeroAccessToken(code: string, address: string){ getXeroAccessToken(code: string){
const params = this.reqParams.append('code', code).append('address', address); const params = this.reqParams.append('code', code);
let obs = this.http.get(this.beUrl + 'api/xerotoken' , {headers: this.reqHeaders, params: params, observe: 'response'}); let obs = this.http.get(this.beUrl + 'api/xerotoken' , {headers: this.reqHeaders, params: params, observe: 'response'});
return obs; return obs;
} }

View file

@ -77,7 +77,7 @@ export class XeroRegComponent implements OnInit {
this.activatedRoute.queryParams.subscribe((params) => { this.activatedRoute.queryParams.subscribe((params) => {
//console.log(params); //console.log(params);
if (params.state === this.owner.address.substring(0,6)) { 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) { if (tokenData.status == 200) {
//console.log(tokenData.body!); //console.log(tokenData.body!);
this.flag = true; this.flag = true;