Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FIX (workspaces): Link the invitation email to the instance root and send unknown web app addresses there, so invited people reach the sign-up form instead of a blank page

Rostislav Dugin817145fd8cfc
diff --git a/backend/internal/features/workspaces/controllers/membership_controller_test.go b/backend/internal/features/workspaces/controllers/membership_controller_test.go
index 9f205894..ddd5c2a1 100644
--- a/backend/internal/features/workspaces/controllers/membership_controller_test.go
+++ b/backend/internal/features/workspaces/controllers/membership_controller_test.go
@@ -9,9 +9,12 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
+ "databasus-backend/internal/config"
+ "databasus-backend/internal/features/email"
users_enums "databasus-backend/internal/features/users/enums"
users_testing "databasus-backend/internal/features/users/testing"
workspaces_dto "databasus-backend/internal/features/workspaces/dto"
+ workspaces_services "databasus-backend/internal/features/workspaces/services"
workspaces_testing "databasus-backend/internal/features/workspaces/testing"
test_utils "databasus-backend/internal/util/testing"
)
@@ -329,6 +332,67 @@ func Test_AddMemberToWorkspace_WithNonExistentUser_ReturnsInvited(t *testing.T)
assert.True(t, response.Status == workspaces_dto.AddStatusInvited)
}
+func Test_AddMemberToWorkspace_WithNonExistentUser_InvitationLinksToConfiguredUrl(t *testing.T) {
+ for _, databasusURL := range []string{
+ "https://databasus.example.com",
+ "https://databasus.example.com/",
+ } {
+ t.Run(databasusURL, func(t *testing.T) {
+ mockEmailSender := useMockMembershipEmailSender(t)
+ useDatabasusURL(t, databasusURL)
+
+ router := workspaces_testing.CreateTestRouter(
+ GetWorkspaceController(),
+ GetMembershipController(),
+ )
+ owner := users_testing.CreateTestUser(t.Context(), users_enums.UserRoleMember)
+
+ workspace, _ := workspaces_testing.CreateTestWorkspaceViaAPI(t.Context(), "Test Workspace", owner, router)
+ defer workspaces_testing.RemoveTestWorkspace(t.Context(), workspace, router)
+
+ request := workspaces_dto.AddMemberRequestDTO{
+ Email: uuid.New().String() + "@example.com",
+ Role: users_enums.WorkspaceRoleViewer,
+ }
+
+ test_utils.MakePostRequest(
+ t,
+ router,
+ "/api/v1/workspaces/memberships/"+workspace.ID.String()+"/members",
+ "Bearer "+owner.Token,
+ request,
+ http.StatusOK,
+ )
+
+ assert.Len(t, mockEmailSender.SendEmailCalls, 1)
+ assert.Equal(t, request.Email, mockEmailSender.SendEmailCalls[0].To)
+ assert.Contains(t, mockEmailSender.SendEmailCalls[0].Body, `href="`+databasusURL+`"`)
+ })
+ }
+}
+
+func useMockMembershipEmailSender(t *testing.T) *workspaces_testing.MockEmailSender {
+ t.Helper()
+
+ mockEmailSender := workspaces_testing.NewMockEmailSender()
+ workspaces_services.GetMembershipService().SetEmailSender(mockEmailSender)
+ t.Cleanup(func() {
+ workspaces_services.GetMembershipService().SetEmailSender(email.GetEmailSMTPSender())
+ })
+
+ return mockEmailSender
+}
+
+func useDatabasusURL(t *testing.T, databasusURL string) {
+ t.Helper()
+
+ originalDatabasusURL := config.GetEnv().DatabasusURL
+ config.GetEnv().DatabasusURL = databasusURL
+ t.Cleanup(func() {
+ config.GetEnv().DatabasusURL = originalDatabasusURL
+ })
+}
+
func Test_AddMemberToWorkspace_WhenWorkspaceAdminTriesToAddAdmin_ReturnsBadRequest(t *testing.T) {
router := workspaces_testing.CreateTestRouter(
GetWorkspaceController(),
diff --git a/backend/internal/features/workspaces/services/membership_service.go b/backend/internal/features/workspaces/services/membership_service.go
index e5b8ebe7..c39a928f 100644
--- a/backend/internal/features/workspaces/services/membership_service.go
+++ b/backend/internal/features/workspaces/services/membership_service.go
@@ -32,6 +32,10 @@ type MembershipService struct {
logger *slog.Logger
}
+func (s *MembershipService) SetEmailSender(sender workspaces_interfaces.EmailSender) {
+ s.emailSender = sender
+}
+
func (s *MembershipService) GetMembers(
ctx context.Context,
workspaceID uuid.UUID,
@@ -370,7 +374,7 @@ func (s *MembershipService) buildInvitationEmailHTML(
signUpLink := ""
if env.DatabasusURL != "" {
signUpLink = fmt.Sprintf(`<p style="margin: 20px 0;">
- <a href="%s/sign-up" style="display: inline-block; padding: 12px 24px; background-color: #0d6efd; color: white; text-decoration: none; border-radius: 4px;">
+ <a href="%s" style="display: inline-block; padding: 12px 24px; background-color: #0d6efd; color: white; text-decoration: none; border-radius: 4px;">
Sign up
</a>
</p>`, env.DatabasusURL)
diff --git a/frontend/src/App.tsx b/frontend/src/app/ui/App.tsx
similarity index 68%
rename from frontend/src/App.tsx
rename to frontend/src/app/ui/App.tsx
index 322cc0ab..3667fffe 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/app/ui/App.tsx
@@ -1,16 +1,16 @@
import { App as AntdApp, ConfigProvider, theme } from 'antd';
import { useEffect, useState } from 'react';
-import { BrowserRouter, Route } from 'react-router';
+import { BrowserRouter, Navigate, Route } from 'react-router';
import { Routes } from 'react-router';
-import { userApi } from './entity/users';
-import { AuthPageComponent } from './pages/AuthPageComponent';
-import { OAuthCallbackPage } from './pages/OAuthCallbackPage';
-import { OauthStorageComponent } from './pages/OauthStorageComponent';
-import { useVersionCheck } from './shared/hooks/useVersionCheck';
-import { LocaleProvider, useLocale } from './shared/i18n';
-import { ThemeProvider, useTheme } from './shared/theme';
-import { MainScreenComponent } from './widgets/main/MainScreenComponent';
+import { userApi } from '../../entity/users';
+import { AuthPageComponent } from '../../pages/AuthPageComponent';
+import { OAuthCallbackPage } from '../../pages/OAuthCallbackPage';
+import { OauthStorageComponent } from '../../pages/OauthStorageComponent';
+import { useVersionCheck } from '../../shared/hooks/useVersionCheck';
+import { LocaleProvider, useLocale } from '../../shared/i18n';
+import { ThemeProvider, useTheme } from '../../shared/theme';
+import { MainScreenComponent } from '../../widgets/main/MainScreenComponent';
function AppContent() {
const [isAuthorized, setIsAuthorized] = useState(false);
@@ -47,6 +47,7 @@ function AppContent() {
path="/"
element={!isAuthorized ? <AuthPageComponent /> : <MainScreenComponent />}
/>
+ <Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</BrowserRouter>
</AntdApp>
diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx
index 1952ae8b..54ad5802 100644
--- a/frontend/src/main.tsx
+++ b/frontend/src/main.tsx
@@ -3,7 +3,7 @@ import utc from 'dayjs/plugin/utc';
import { createRoot } from 'react-dom/client';
import './index.css';
-import App from './App.tsx';
+import App from './app/ui/App.tsx';
dayjs.extend(utc);
diff --git a/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/.openspec.yaml b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/.openspec.yaml
new file mode 100644
index 00000000..53f62d70
--- /dev/null
+++ b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-10-10
diff --git a/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/design.md b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/design.md
new file mode 100644
index 00000000..c3fde42b
--- /dev/null
+++ b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/design.md
@@ -0,0 +1,78 @@
+## Context
+
+See proposal.md for the problem. The current state that shapes the fix:
+
+- `buildInvitationEmailHTML` appends `/sign-up` to `DATABASUS_URL` when the variable is set (`backend/internal/features/workspaces/services/membership_service.go:366-380`). No other code builds a link from `DATABASUS_URL`. The other two readers only derive the SMTP greeting name from it (`backend/internal/features/email/di.go:27`, `backend/internal/features/notifiers/models/email_notifier/model.go:102`).
+- The backend answers every unmatched path with `index.html` (`backend/cmd/main.go:560-572`). An unknown path therefore loads the web app rather than returning 404.
+- The web app's route table has three entries: `/auth/callback`, `/storages/google-oauth` and `/` (`frontend/src/App.tsx:44-50`). Nothing matches any other path, and React Router renders nothing.
+- At `/`, a visitor who is not signed in gets `AuthPageComponent`, which starts in sign-up mode (`frontend/src/pages/AuthPageComponent.tsx:21-23`). The root already is the sign-up page.
+- Signing up with an invited address activates the existing invited account and keeps its workspace membership (`backend/internal/features/users/services/user_services.go:64-109`). The sign-up form needs no extra parameter for the invitation to take effect.
+- The membership service receives the SMTP sender in its composite literal (`backend/internal/features/workspaces/services/di.go:26-35`) and offers no way to replace it. The user service has `SetEmailSender` for this (`backend/internal/features/users/services/user_services.go:54-56`), and its controller tests use it (`backend/internal/features/users/controllers/password_reset_test.go:22-23`). The workspaces package already has `MockEmailSender` (`backend/internal/features/workspaces/testing/mocks.go`), with no caller.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- The invitation link opens the sign-up form for every value of `DATABASUS_URL` an operator could reasonably write, including one with a trailing slash.
+- Links in invitation emails that were already sent start working without any action from the operator.
+- The link the email contains is pinned by a test that goes through the HTTP API.
+
+**Non-Goals:**
+
+- Normalizing `DATABASUS_URL` at configuration load. With nothing appended to it, the email has no reason to normalize it.
+
+## Decisions
+
+### The link is `DATABASUS_URL` itself
+
+The "Sign up" link becomes the configured `DATABASUS_URL`, unchanged.
+
+Alternatives rejected:
+
+- **Keep `/sign-up` and add a matching page.** A `/sign-up` page would render what `/` already renders. It adds an address the web app must keep serving and gives the user nothing. A dedicated page earns its place only when it does something the root does not, such as reading an invitation token. That work is out of scope.
+- **Trim a trailing slash, then append a path.** This only matters while a path is appended. Linking to the root removes the reason to trim.
+- **Change only the backend.** Emails already sent would keep pointing at `/sign-up` and keep showing a blank page.
+
+### The router moves to the `app/` layer
+
+`frontend/src/App.tsx` moves to `frontend/src/app/ui/App.tsx`, its relative imports are updated, and `frontend/src/main.tsx:6` imports it from the new place. The file holds the app-wide providers and the router, which `frontend/AGENTS.md` ("Where new code goes") places in `app/`, a layer that has segments and no slices. `frontend/src/app/` does not exist yet. Root `AGENTS.md` ("Refactoring within a feature") makes fixing a module-doc violation in touched code part of the same task. The move touches one file and one import and changes no behavior.
+
+Alternatives rejected:
+
+- **Leave the file at `frontend/src/App.tsx`.** The route table this change edits would stay outside the layer the frontend rules assign it to, and the rule would be broken again by the next router edit.
+- **`frontend/src/app/App.tsx` without a segment.** `app/` takes segments only, and `ui/` is the segment for components.
+
+### Unknown paths redirect to `/`
+
+The route table gains a catch-all `*` route that renders `<Navigate to="/" replace />`.
+
+Alternatives rejected:
+
+- **Render the root's content at any path.** The address bar would keep showing `/sign-up` or a typo, and a later route added at that address would silently change what an old link shows.
+- **Show a "page not found" screen.** The only known unknown path is the one in sent invitation emails. A not-found screen would leave those people one more click from the form, and it needs translated text in six dictionaries.
+- **A redirect without `replace`.** The unknown address would stay in the history, and the back button would bounce the user to it and straight back to `/`.
+
+### The test drives the HTTP API with a replaced email sender
+
+`MembershipService` gets `SetEmailSender`, mirroring the user service. A controller test in `membership_controller_test.go` swaps in the existing `workspaces_testing.MockEmailSender`, sets `config.GetEnv().DatabasusURL`, adds a member with an unknown address through `POST /api/v1/workspaces/memberships/{id}/members`, and asserts the `href` in the captured body. The test restores the sender and the URL in `t.Cleanup`, because both live in package-level state shared by the other tests in the package.
+
+Alternatives rejected:
+
+- **A unit test of `buildInvitationEmailHTML`.** `backend/AGENTS.md` prefers controller tests and reserves unit tests for complex model logic with no API surface. Building an email string is neither.
+- **A constructor parameter instead of a setter.** The service is a package-level composite literal built at init. A different construction path would be a wider change than the one the user service already set the pattern for.
+
+### No automated frontend test for the catch-all
+
+The frontend change is verified by `pnpm typecheck`, `pnpm lint` and `pnpm build`. They prove the route compiles, but no automated test pins the redirect itself.
+
+Alternatives rejected:
+
+- **A component test.** Vitest runs in the `node` environment (`frontend/vitest.config.ts:12`), and the project has no DOM environment or Testing Library. Adding both for one declarative route costs more than the route.
+- **A `matchRoutes` test against the route table.** The routes are inline JSX inside `AppContent` and depend on its state. Testing them this way would mean extracting the table first, which is restructuring for the test's sake.
+
+## Risks / Trade-offs
+
+- [An operator sets `DATABASUS_URL` to an address that does not open the web app root] → The email now links to exactly what the operator configured, so the link is as correct as the setting. This was already true for the `/sign-up` link.
+- [The catch-all hides a future route that is mistyped in a link] → The user lands on the main screen instead of a blank page. That is a better failure, but it makes a broken link quieter. Accepted.
+- [No automated test pins the redirect] → A later edit of the route table could drop the catch-all unnoticed. The route is one declarative line next to the others, and the gap closes for free if the project later adds a DOM test environment.
+- [The test mutates package-level state] → No test in the package runs in parallel, and the test restores both values in `t.Cleanup`.
diff --git a/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/proposal.md b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/proposal.md
new file mode 100644
index 00000000..32f5ca05
--- /dev/null
+++ b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/proposal.md
@@ -0,0 +1,35 @@
+## Why
+
+A person invited to a workspace who has no Databasus account receives an email with a "Sign up" button. The button opens `<DATABASUS_URL>/sign-up`, which the web app has no page for, so the invited person sees a blank page and cannot create the account. The workaround is to open the instance root by hand, which the email never mentions.
+
+## What Changes
+
+- The "Sign up" button in the invitation email links to the configured `DATABASUS_URL` exactly as the operator wrote it, with no path appended. The root of the web app already shows the sign-up form to a visitor who is not signed in. Because nothing is appended, a trailing slash in `DATABASUS_URL` no longer matters.
+- The web app sends any address it has no page for to its root instead of rendering a blank page. This repairs the `/sign-up` links in invitation emails that were already sent.
+- The membership service gains a way for tests to replace its email sender, the same way the user service already allows. The test double for it already exists in the workspaces testing package and has no caller today.
+
+Out of scope:
+
+- An invitation token or any other secret in the invitation link.
+- Invited accounts completing sign-up without proving they own the email address, and without the external registration setting being checked. This is a separate security question and needs its own change.
+- A dedicated `/sign-up` page or any other new address in the web app.
+- Filling in the invited email address on the sign-up form.
+- The invitation email's text, layout and the branch used when `DATABASUS_URL` is not set.
+- Escaping `DATABASUS_URL` inside the email markup.
+
+## Capabilities
+
+### New Capabilities
+
+- `workspace-invitations`: what an invited person gets from the invitation email and where its link leads, plus how the web app answers an address it has no page for.
+
+### Modified Capabilities
+
+None.
+
+## Impact
+
+- Backend: `buildInvitationEmailHTML` and a test seam in `backend/internal/features/workspaces/services/membership_service.go`, and a new controller test in `backend/internal/features/workspaces/controllers/membership_controller_test.go`.
+- Frontend: `frontend/src/App.tsx` moves to `frontend/src/app/ui/App.tsx`, where the frontend rules place the router, and gains the catch-all route; `frontend/src/main.tsx` imports it from there.
+- No API, schema or configuration change. Nothing breaks for existing callers.
+- Rules this change answers to: `AGENTS.md`, `backend/AGENTS.md`, `frontend/AGENTS.md`.
diff --git a/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/specs/workspace-invitations/spec.md b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/specs/workspace-invitations/spec.md
new file mode 100644
index 00000000..dda3f135
--- /dev/null
+++ b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/specs/workspace-invitations/spec.md
@@ -0,0 +1,43 @@
+## Purpose
+
+Describes what a person invited to a workspace without a Databasus account receives by email, and where the invitation leads them, so they can create the account and reach the workspace.
+
+## ADDED Requirements
+
+### Requirement: The invitation email leads to the sign-up form
+
+When the instance's public address is configured, the invitation email sent to a person without an account SHALL contain a "Sign up" link to that address exactly as the operator configured it, with no path added. Opening the link while not signed in SHALL show the sign-up form.
+
+#### Scenario: Public address without a trailing slash
+
+- **WHEN** the public address is `https://databasus.example.com` and a workspace owner adds a member by an email address that has no account
+- **THEN** the invitation email's "Sign up" link points to `https://databasus.example.com`
+
+#### Scenario: Public address with a trailing slash
+
+- **WHEN** the public address is `https://databasus.example.com/` and a workspace owner adds a member by an email address that has no account
+- **THEN** the invitation email's "Sign up" link points to `https://databasus.example.com/`
+
+#### Scenario: Invited person opens the link
+
+- **WHEN** the invited person opens the "Sign up" link in a browser that is not signed in to the instance
+- **THEN** the sign-up form is shown, and completing it with the invited address gives the account the workspace membership from the invitation
+
+### Requirement: An unknown address in the web app leads to the main screen
+
+The web app SHALL send any address it has no page for to its root, replacing the unknown address in the browser history. It SHALL never render a blank page for such an address. This includes the `/sign-up` address that earlier invitation emails link to.
+
+#### Scenario: Link from an earlier invitation email
+
+- **WHEN** a visitor who is not signed in opens `<public address>/sign-up`
+- **THEN** the browser ends up at the root of the web app and the sign-up form is shown
+
+#### Scenario: Unknown address while signed in
+
+- **WHEN** a signed-in user opens an address the web app has no page for
+- **THEN** the browser ends up at the root of the web app and the user's main screen is shown
+
+#### Scenario: Back navigation after the redirect
+
+- **WHEN** a visitor is sent from an unknown address to the root and then presses the browser's back button
+- **THEN** the browser returns to the page before the unknown address instead of to the unknown address again
diff --git a/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/tasks.md b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/tasks.md
new file mode 100644
index 00000000..d570561c
--- /dev/null
+++ b/openspec/changes/archive/2026-10-10-fix-invitation-sign-up-link/tasks.md
@@ -0,0 +1,15 @@
+## 1. Invitation link
+
+- [x] 1.1 Add `SetEmailSender` to `MembershipService` in `backend/internal/features/workspaces/services/membership_service.go`, mirroring `UserService.SetEmailSender`, and verify with `go build ./...` in `backend/`
+- [x] 1.2 Add controller tests to `backend/internal/features/workspaces/controllers/membership_controller_test.go` that replace the sender with `workspaces_testing.MockEmailSender`, set `config.GetEnv().DatabasusURL` to `https://databasus.example.com` and to `https://databasus.example.com/`, add a member with an unknown address, and assert that the captured body contains `href="<configured value>"` exactly. Restore the sender and the URL in `t.Cleanup`. Verify that both tests fail with `just test-package ./internal/features/workspaces/...` in `backend/` while the link still appends `/sign-up`
+- [x] 1.3 Make `buildInvitationEmailHTML` link to `env.DatabasusURL` with no path appended, and verify that the tests from 1.2 pass with `just test-package ./internal/features/workspaces/... ./internal/features/users/...` in `backend/`. The same run includes the existing `Test_InviteUserToWorkspace_MembershipReceivedAfterSignUp` in `backend/internal/features/users/controllers/management_controller_test.go`, which pins the membership half of the "Invited person opens the link" scenario
+
+## 2. Unknown addresses in the web app
+
+- [x] 2.1 Move `frontend/src/App.tsx` to `frontend/src/app/ui/App.tsx` with `git mv`, update its relative imports and the import in `frontend/src/main.tsx`, and verify with `pnpm typecheck`, `pnpm lint` and `pnpm build` in `frontend/`
+- [x] 2.2 Add a catch-all `*` route rendering `<Navigate to="/" replace />` to the route table in `frontend/src/app/ui/App.tsx`, after the existing routes, and verify with `pnpm typecheck` and `pnpm lint` in `frontend/`. The three scenarios of "An unknown address in the web app leads to the main screen" and the "sign-up form is shown" half of "Invited person opens the link" are deliberately left without an automated test, per the design decision "No automated frontend test for the catch-all"
+
+## 3. Verification
+
+- [x] 3.1 Run `just lint` at the root, and `pnpm test` and `pnpm build` in `frontend/`
+- [x] 3.2 Run `openspec validate fix-invitation-sign-up-link --strict`
diff --git a/openspec/specs/workspace-invitations/spec.md b/openspec/specs/workspace-invitations/spec.md
new file mode 100644
index 00000000..8c6af5bb
--- /dev/null
+++ b/openspec/specs/workspace-invitations/spec.md
@@ -0,0 +1,45 @@
+# Workspace Invitations Specification
+
+## Purpose
+
+Describes what a person invited to a workspace without a Databasus account receives by email, and where the invitation leads them, so they can create the account and reach the workspace.
+
+## Requirements
+
+### Requirement: The invitation email leads to the sign-up form
+
+When the instance's public address is configured, the invitation email sent to a person without an account SHALL contain a "Sign up" link to that address exactly as the operator configured it, with no path added. Opening the link while not signed in SHALL show the sign-up form.
+
+#### Scenario: Public address without a trailing slash
+
+- **WHEN** the public address is `https://databasus.example.com` and a workspace owner adds a member by an email address that has no account
+- **THEN** the invitation email's "Sign up" link points to `https://databasus.example.com`
+
+#### Scenario: Public address with a trailing slash
+
+- **WHEN** the public address is `https://databasus.example.com/` and a workspace owner adds a member by an email address that has no account
+- **THEN** the invitation email's "Sign up" link points to `https://databasus.example.com/`
+
+#### Scenario: Invited person opens the link
+
+- **WHEN** the invited person opens the "Sign up" link in a browser that is not signed in to the instance
+- **THEN** the sign-up form is shown, and completing it with the invited address gives the account the workspace membership from the invitation
+
+### Requirement: An unknown address in the web app leads to the main screen
+
+The web app SHALL send any address it has no page for to its root, replacing the unknown address in the browser history. It SHALL never render a blank page for such an address. This includes the `/sign-up` address that earlier invitation emails link to.
+
+#### Scenario: Link from an earlier invitation email
+
+- **WHEN** a visitor who is not signed in opens `<public address>/sign-up`
+- **THEN** the browser ends up at the root of the web app and the sign-up form is shown
+
+#### Scenario: Unknown address while signed in
+
+- **WHEN** a signed-in user opens an address the web app has no page for
+- **THEN** the browser ends up at the root of the web app and the user's main screen is shown
+
+#### Scenario: Back navigation after the redirect
+
+- **WHEN** a visitor is sent from an unknown address to the root and then presses the browser's back button
+- **THEN** the browser returns to the page before the unknown address instead of to the unknown address again