From e379fe989a0f9c14b8b297cae8bd480d2d2fbe45 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sun, 30 Oct 2022 19:56:29 -0700 Subject: [PATCH] send redirect_uri. --- .../src/app/pages/auth-signin/auth-signin.component.ts | 10 ++++++---- frontend/src/app/services/auth.service.ts | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/pages/auth-signin/auth-signin.component.ts b/frontend/src/app/pages/auth-signin/auth-signin.component.ts index 47e4bb62..1481d9e5 100644 --- a/frontend/src/app/pages/auth-signin/auth-signin.component.ts +++ b/frontend/src/app/pages/auth-signin/auth-signin.component.ts @@ -30,12 +30,14 @@ export class AuthSigninComponent implements OnInit { ngOnInit(): void { - const idpType = this.route.snapshot.paramMap.get('idp_type') + let idpType = this.route.snapshot.paramMap.get('idp_type') if(idpType){ - const params = new URLSearchParams(window.location.hash.substring(1)) - const code = params.get('code') // eyJhbGciOiJSUzI1...rest_of_ID_Token + let params = new URLSearchParams(window.location.hash.substring(1)) + let code = params.get('code') // eyJhbGciOiJSUzI1...rest_of_ID_Token + let redirect_uri = `${window.location.origin}${window.location.pathname}` + this.resetUrlOnCallback() - this.authService.IdpCallback(idpType, code).then(console.log) + this.authService.IdpCallback(idpType, code, redirect_uri).then(console.log) } } diff --git a/frontend/src/app/services/auth.service.ts b/frontend/src/app/services/auth.service.ts index 0d870235..8d6c5959 100644 --- a/frontend/src/app/services/auth.service.ts +++ b/frontend/src/app/services/auth.service.ts @@ -28,10 +28,11 @@ export class AuthService { window.location.href = authorizeUrl.toString(); } - public async IdpCallback(idp_type: string, code: string) { + public async IdpCallback(idp_type: string, code: string, redirect_uri: string) { var payload = { - code: code + code: code, + redirect_uri: redirect_uri } let fastenApiEndpointBase = GetEndpointAbsolutePath(globalThis.location,environment.fasten_api_endpoint_base)