use SMB_DASHBOARD_URL for logout redirect#15
Closed
aznszn wants to merge 2 commits into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes logout to redirect users to a configured SMB dashboard URL instead of deriving a portal hostname from the current origin, and wires that new frontend environment variable into the web app build/config.
Changes:
- Replace logout’s host-rewrite redirect with
NEXT_PUBLIC_SMB_DASHBOARD_URL. - Add
NEXT_PUBLIC_SMB_DASHBOARD_URLto frontend env examples and Docker build args/env. - Add a Next.js config-time check that fails builds when the new env var is missing.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
surfsense_web/next.config.ts |
Adds a required-env guard for the new dashboard URL. |
surfsense_web/lib/auth-utils.ts |
Switches logout redirect logic to use the configured SMB dashboard URL. |
surfsense_web/Dockerfile |
Introduces the new frontend env var into the image build environment. |
surfsense_web/.env.example |
Documents the new dashboard URL variable for local frontend setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+13
| // Compulsory build-time env vars | ||
| const REQUIRED_ENV_VARS = ["NEXT_PUBLIC_SMB_DASHBOARD_URL"] as const; | ||
| for (const key of REQUIRED_ENV_VARS) { | ||
| if (!process.env[key]) { | ||
| throw new Error(`Missing required environment variable: ${key}`); |
Comment on lines
+47
to
+58
| @@ -54,6 +55,7 @@ ENV NEXT_PUBLIC_OAUTH2_PROXY_URL=$NEXT_PUBLIC_OAUTH2_PROXY_URL | |||
| ENV NEXT_PUBLIC_LOGOUT_REDIRECT_URL=$NEXT_PUBLIC_LOGOUT_REDIRECT_URL | |||
| ENV NEXT_PUBLIC_OIDC_LOGOUT_URL=$NEXT_PUBLIC_OIDC_LOGOUT_URL | |||
| ENV NEXT_PUBLIC_OIDC_CLIENT_ID=$NEXT_PUBLIC_OIDC_CLIENT_ID | |||
| ENV NEXT_PUBLIC_SMB_DASHBOARD_URL=$NEXT_PUBLIC_SMB_DASHBOARD_URL | |||
| @@ -1,4 +1,5 @@ | |||
| NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000 | |||
| NEXT_PUBLIC_SMB_DASHBOARD_URL=https://<dashboard-domain> | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist