send redirect_uri.

This commit is contained in:
Jason Kulatunga 2022-10-30 19:56:29 -07:00
parent 52802323ee
commit e379fe989a
2 changed files with 9 additions and 6 deletions

View File

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

View File

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