Skip to content

Commit

Permalink
Fix/double redirect issue (#1923)
Browse files Browse the repository at this point in the history
* double-redirect-issue

* protect double redirect

* Take one

* remove logs

* remove logs

* Remove test data

* fix logic

* 🤖 GITHUB ACTIONS

* Revert ublock fix

* Rever unrequired changes

* Add logs

* 🤖 GITHUB ACTIONS
  • Loading branch information
leomendoza123 authored Mar 30, 2023
1 parent 006249d commit c361894
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/app/guards/authorize.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,19 @@ export class AuthorizeGuard implements CanActivateChild {
}

sendUserToRedirectURL(oauthSession: RequestInfoForm): Observable<boolean> {
if (this.lastRedirectUrl !== oauthSession.redirectUrl) {
this.lastRedirectUrl = oauthSession.redirectUrl
this.window.location.href = oauthSession.redirectUrl
}
console.log('sendUserToRedirectURL ', oauthSession)

// if (this.lastRedirectUrl !== oauthSession.redirectUrl) {
// this.lastRedirectUrl = oauthSession.redirectUrl
this.window.location.href = oauthSession.redirectUrl
// }

return NEVER
}

reportAlreadyAuthorize(request: RequestInfoForm) {
console.log('reportAlreadyAuthorize')

const analyticsReports: Observable<void>[] = []
analyticsReports.push(
this._gtag.reportEvent(`Reauthorize`, 'RegGrowth', request)
Expand All @@ -84,14 +89,14 @@ export class AuthorizeGuard implements CanActivateChild {
)

return forkJoin(analyticsReports).pipe(
take(1),
switchMap((value) => {
if (value[0] === undefined && value[1] === undefined) {
return throwError('blocked-analytics')
} else {
return of(value)
tap(
(value) => {
console.log('reportAlreadyAuthorize tap', value)
},
(err) => {
console.log('reportAlreadyAuthorize tap err', err)
}
}),
),
catchError((err) => {
this._errorHandler.handleError(
err,
Expand Down

0 comments on commit c361894

Please sign in to comment.