Skip to content

Redirect to client app after email verification#13

Merged
alejandro-runner merged 1 commit intosynvya-stagingfrom
fix/email-verify-redirect
Apr 13, 2026
Merged

Redirect to client app after email verification#13
alejandro-runner merged 1 commit intosynvya-stagingfrom
fix/email-verify-redirect

Conversation

@alejandro-runner
Copy link
Copy Markdown
Member

Summary

  • Adds optional redirect_uri parameter to /api/auth/register so client apps can specify where users should return after email verification
  • Stores redirect_uri in the users table and returns it as redirect_to in the verify-email response
  • Frontend already handles redirect_to (OAuth redirect logic), so no frontend changes needed

Closes #12

Changes

File What
database/migrations/20260412000000_add_user_redirect_uri.sql Adds nullable redirect_uri column to users
core/src/repositories/user.rs Stores/retrieves redirect_uri in registration and verification queries
api/src/api/http/auth.rs Accepts redirect_uri on register, validates it (HTTPS or localhost), returns it after verification with ?verified=1

How it works

  1. Client app sends POST /api/auth/register with redirect_uri: "https://account.staging.synvya.com"
  2. Keycast stores it alongside the verification token
  3. After email verification, backend returns redirect_to: "https://account.staging.synvya.com?verified=1"
  4. Existing frontend redirect logic kicks in — user lands back on the client app

Client-side change required

The Synvya account app needs to include redirect_uri in its registration request body.

Test plan

  • Register with redirect_uri set → verify email → confirm redirect to client app with ?verified=1
  • Register without redirect_uri → verify email → confirm existing behavior (redirect to /)
  • Register with invalid redirect_uri (e.g. ftp://...) → confirm it's silently ignored
  • Re-verify already-verified email → confirm no redirect (existing behavior)

🤖 Generated with Claude Code

After verifying their email, users were landing on the Keycast dashboard
instead of being redirected back to the originating client app (e.g.
account.synvya.com). This adds an optional redirect_uri parameter to
registration that is stored and returned as redirect_to after
verification, leveraging the existing frontend redirect logic.

Closes #12

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alejandro-runner alejandro-runner merged commit 9d34869 into synvya-staging Apr 13, 2026
@alejandro-runner alejandro-runner deleted the fix/email-verify-redirect branch April 13, 2026 03:20
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.

Email verification lands on Keycast dashboard instead of redirecting back to client app

1 participant