Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
div360 committed Oct 3, 2024
1 parent 4f5cf81 commit 3c7caba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/app/auth/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export class LoginComponent implements OnInit {
private userService: UserService
) { }

private redirect(redirectUri: string | undefined): void {
private redirect(redirectUri: string | undefined, code:string): void {
if (redirectUri) {
this.router.navigate([redirectUri]);
this.router.navigate([redirectUri + `?code=${code}`] );
} else {
this.router.navigate(['/integrations']);
}
Expand Down Expand Up @@ -106,9 +106,9 @@ export class LoginComponent implements OnInit {
this.helperService.setBaseApiURL(AppUrl.XERO);
this.xeroAuthService.loginWithRefreshToken(clusterDomainWithToken.tokens.refresh_token).subscribe();
}
this.redirect(redirectUri);
this.redirect(redirectUri, code);
} else {
this.redirect(redirectUri);
this.redirect(redirectUri, code);
}
});
});
Expand Down
3 changes: 1 addition & 2 deletions src/app/integrations/intacct/intacct.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ export class IntacctComponent implements OnInit {

private handleAuthParameters(): void {
this.route.queryParams.subscribe(params => {
const loginRequired = params.login_required === 'true';
const authCode = params.authCode;

if (loginRequired && authCode) {
if ( authCode) {
this.siAuthService.loginWithAuthCode(authCode).subscribe(
() => this.getOrCreateWorkspace()
);
Expand Down
3 changes: 1 addition & 2 deletions src/app/integrations/xero/xero.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,9 @@ export class XeroComponent implements OnInit {

private handleAuthParameters(): void {
this.route.queryParams.subscribe(params => {
const loginRequired = params.login_required === 'true';
const authCode = params.code;

if (loginRequired && authCode) {
if (authCode) {
this.xeroAuthService.login(authCode).subscribe(
() => this.setupWorkspace()
);
Expand Down

0 comments on commit 3c7caba

Please sign in to comment.