Skip to content

fix(access): Correct email access pages and sign-in links - #234

Merged
nfebe merged 2 commits into
mainfrom
fix/deployment-access-policy
Oct 9, 2026
Merged

nfebe merged 2 commits into
mainfrom
fix/deployment-access-policy

Conversation

@nfebe

@nfebe nfebe commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Use the existing FlatRun logo and product styles on access pages. Require confirmation before consuming sign-in links. Requests rejected by the configured access policy now show access denied instead of a check-your-email confirmation; these requests already sent no email. Both allowlist access and verification for any email remain available. Bump to 0.4.0-beta.11.

Reject unlisted addresses before sending sign-in emails, including existing policies.

Wait for confirmation before consuming sign-in links. Use the existing FlatRun
logo and product styles on access pages. Prepare the next beta release.
@sourceant

sourceant Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Code Review Summary

Protected access requests now require the submitted email to match the deployment allowlist; unmatched addresses receive a branded 403 page before any sign-in email is sent. Sign-in links are inspected without being consumed, so users must confirm via POST before the token is consumed and a session issued. Access pages use an embedded FlatRun logo and product styles, and the version is bumped to 0.4.0-beta.11.

🚀 Key Improvements

  • Unlisted emails are denied with a 403 page instead of silently receiving sign-in emails.
  • Magic links split into InspectMagicLink and VerifyMagicLink so confirmation precedes token consumption (internal/access/service.go).
  • Verification previews set no-store and no-referrer headers and embed the FlatRun logo.

💡 Minor Suggestions

  • The resolution-time guard that forced allowlist mode for WordPress deployments was dropped, so a WordPress path saved with any_verified now lets any address that completes a sign-in link reach wp-login.php/wp-admin. Restore the forced mode (or reject any_verified for WordPress at config time) so protected paths require the FlatRun allowlist.
  • Dropping the metadata parameter here removes the config-time check that rejected non-allowlist modes for WordPress deployments, so POST /deployments/:name/domains and PUT .../metadata can now persist any_verified on a WordPress path. Re-add the metadata argument and the wordpress + non-allowlist rejection so the requirement is enforced when policies are saved.

@sourceant sourceant Bot 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.

Review complete. See the overview comment for a summary.

Access restrictions follow each deployment policy. Production sites can require
allowlisted emails without changing the available modes for other deployments.
@nfebe nfebe changed the title fix(wordpress): Require allowlisted emails for protected access fix(access): Correct email access pages and sign-in links Oct 9, 2026

@sourceant sourceant Bot 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.

internal/access/service.go

The resolution-time guard that forced allowlist mode for WordPress deployments was dropped, so a WordPress path saved with any_verified now lets any address that completes a sign-in link reach wp-login.php/wp-admin. Restore the forced mode (or reject any_verified for WordPress at config time) so protected paths require the FlatRun allowlist.

Suggested replacement:

			copy := *domain.Access
			if strings.EqualFold(deployments[i].Metadata.Type, "wordpress") {
				copy.Mode = "allowlist"
			}
			best = &copy

internal/api/deployment_actions.go

Dropping the metadata parameter here removes the config-time check that rejected non-allowlist modes for WordPress deployments, so POST /deployments/:name/domains and PUT .../metadata can now persist any_verified on a WordPress path. Re-add the metadata argument and the wordpress + non-allowlist rejection so the requirement is enforced when policies are saved.

@nfebe
nfebe merged commit 492cabe into main Oct 9, 2026
6 checks passed
@nfebe
nfebe deleted the fix/deployment-access-policy branch October 9, 2026 19:50
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.

1 participant