Skip to content

Fix guest checkout flow and UUID migration constraints#345

Merged
ddon merged 7 commits intoBeamLabEU:devfrom
timujinne:dev
Feb 17, 2026
Merged

Fix guest checkout flow and UUID migration constraints#345
ddon merged 7 commits intoBeamLabEU:devfrom
timujinne:dev

Conversation

@timujinne
Copy link
Contributor

Summary

  • Fix guest checkout transaction failure caused by NOT NULL constraints on legacy integer FK columns
  • Improve guest checkout UX with clearer messaging and email confirmation instructions
  • Add login redirect for existing email during guest checkout
  • Add return_to support in login flow for seamless post-login redirect back to checkout
  • Fix .id to .uuid migration in shop module (Storage, import, catalog pages)
  • Fix Language struct Access error in modules admin page
  • Fix hardcoded "PhoenixKit" fallback in admin header project title

Changes

Guest Checkout Flow

  • Relax NOT NULL on legacy integer FK columns (user_id, role_id, assigned_by) in uuid_fk_columns.ex so guest user creation succeeds
  • Fix double-wrapped error in convert_cart_to_order transaction rollback
  • Add email_exists_error card with login button when guest email is already registered
  • Add cart merge on login via maybe_merge_guest_cart/2 in auth plug
  • Add "converting" cart status for transaction safety

UX Improvements

  • Change checkout warning from alert-warning to alert-info with friendlier messaging
  • Add step-by-step email confirmation instructions on order complete page
  • Add spam folder hint for confirmation emails

Login Return-to Support

  • Login LiveView reads return_to query param and passes as hidden form field
  • Session controller stores return_to in session for post-login redirect
  • Sanitize return_to to prevent open redirect attacks

UUID Migration

  • ADD COLUMN IF NOT EXISTS for idempotent UUID FK column creation
  • Shop module .id.uuid in Storage image lookups (5 web files)
  • Import modules .id.uuid for category references

Other Fixes

  • Fix Language struct map access (["name"].name) in modules admin page
  • Fix project_title default from hardcoded "PhoenixKit" to nil (uses config)

Test Plan

  • Pre-commit checks passed (format, credo, dialyzer)
  • Guest checkout flow tested end-to-end
  • Email confirmation delivery verified
  • Existing email login redirect tested

timujinne and others added 7 commits February 17, 2026 10:29
Change LayoutWrapper project_title attr default from "PhoenixKit" to
nil so modules that don't explicitly pass project_title fall through
to PhoenixKit.Settings.get_project_title() instead of showing the
hardcoded placeholder.
Prevents failure when column already exists, making the migration
idempotent and safe to re-run.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace map access syntax language["field"] with struct syntax
language.field for @languages_default in modules.html.heex.

Language is a struct and does not implement the Access behaviour.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…nstraints

- Replace .id with .uuid in Storage file lookups across shop catalog, product detail, and import modules
- Add NOT NULL relaxation for legacy integer FK columns (user_id, role_id, assigned_by) in role_assignments and role_permissions
- Update checkout complete page with improved guest email confirmation UX
- Replace generic error text with card UI showing "Account already exists"
- Add "Log in to continue" button with return_to=/checkout for seamless flow
- Track email_exists_error state separately from generic error_message
- Login LiveView reads return_to query param and passes it as hidden field
- Session controller stores return_to in session for post-login redirect
- Sanitize return_to to prevent open redirect attacks
- Fix checkout page login link URL construction
@ddon ddon merged commit 71fef5d into BeamLabEU:dev Feb 17, 2026
6 checks passed
ddon pushed a commit that referenced this pull request Feb 17, 2026
- PR #345: Guest checkout flow fixes and UUID migration constraints
- PR #346: Typed structs replacing plain maps across 20 modules
ddon pushed a commit that referenced this pull request Feb 17, 2026
Includes all changes from PR #345 (guest checkout fixes) and PR #346
(20 typed structs replacing plain maps). Fixes Language struct Access
error on admin modules page that affected 1.7.42 upgrades.
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

Comments