Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-webapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
--build-arg NEXT_PUBLIC_HCS_TOPIC_ID="${{ vars.NEXT_PUBLIC_HCS_TOPIC_ID }}" \
--build-arg NEXT_PUBLIC_AUTH0_REDIRECT_URI="${{ vars.NEXT_PUBLIC_AUTH0_REDIRECT_URI }}" \
--build-arg NEXT_PUBLIC_AUTH0_POST_LOGOUT_REDIRECT_URI="${{ vars.NEXT_PUBLIC_AUTH0_POST_LOGOUT_REDIRECT_URI }}" \
--build-arg NEXT_PUBLIC_ONBOARDING_URL="${{ vars.NEXT_PUBLIC_ONBOARDING_URL }}" \
-t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest

Expand Down
9 changes: 8 additions & 1 deletion src/components/AuthGuard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ export default function AuthGuard() {
// We allow /public and /unauthorized pages (for error pages)
if (!token && !pathname.startsWith("/public") && !pathname.startsWith("/unauthorized")) {
const redirectUrl = encodeURIComponent(window.location.href);
window.location.href = `http://localhost:3000/auth/authenticate?redirect=${redirectUrl}`;
const onboardingUrl = process.env.NEXT_PUBLIC_ONBOARDING_URL;

if (!onboardingUrl) {
console.error("NEXT_PUBLIC_ONBOARDING_URL is not defined");
return;
}

window.location.href = `${onboardingUrl}/auth/authenticate?redirect=${redirectUrl}`;
return;
}

Expand Down