From 6c5c6dd1e814a778e68f889ea7d72b1df2f79be4 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Wed, 16 Jun 2021 17:24:32 +0200 Subject: [PATCH] Improve TWA onboarding Redirect to the account registration page --- apps/client/src/app/core/auth.guard.ts | 5 +- .../src/app/pages/register/register-page.html | 2 +- .../src/app/pages/webauthn/webauthn-page.html | 56 ++++++++++--------- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/apps/client/src/app/core/auth.guard.ts b/apps/client/src/app/core/auth.guard.ts index 318e6a82e..d196cb68d 100644 --- a/apps/client/src/app/core/auth.guard.ts +++ b/apps/client/src/app/core/auth.guard.ts @@ -40,7 +40,10 @@ export class AuthGuard implements CanActivate { .get() .pipe( catchError(() => { - if (AuthGuard.PUBLIC_PAGE_ROUTES.includes(state.url)) { + if (route.queryParams?.utm_source) { + this.router.navigate(['/register']); + resolve(false); + } else if (AuthGuard.PUBLIC_PAGE_ROUTES.includes(state.url)) { resolve(true); return EMPTY; } else if (state.url !== '/start') { diff --git a/apps/client/src/app/pages/register/register-page.html b/apps/client/src/app/pages/register/register-page.html index d2db0e3d8..91fc4accd 100644 --- a/apps/client/src/app/pages/register/register-page.html +++ b/apps/client/src/app/pages/register/register-page.html @@ -2,7 +2,7 @@