Skip to content

use SMB_DASHBOARD_URL for logout redirect#15

Closed
aznszn wants to merge 2 commits into
foss-mainfrom
fix/logout-url
Closed

use SMB_DASHBOARD_URL for logout redirect#15
aznszn wants to merge 2 commits into
foss-mainfrom
fix/logout-url

Conversation

@aznszn

@aznszn aznszn commented May 4, 2026

Copy link
Copy Markdown

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_URL to 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 thread surfsense_web/Dockerfile Outdated
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
Comment thread surfsense_web/.env.example Outdated
@@ -1,4 +1,5 @@
NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_SMB_DASHBOARD_URL=https://<dashboard-domain>
@aznszn aznszn closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants