Skip to content

improve signup experience#37

Merged
f0reachARR merged 1 commit intomainfrom
feature/signup-experience
Apr 23, 2026
Merged

improve signup experience#37
f0reachARR merged 1 commit intomainfrom
feature/signup-experience

Conversation

@f0reachARR
Copy link
Copy Markdown
Member

No description provided.

@f0reachARR f0reachARR enabled auto-merge April 23, 2026 07:12
@f0reachARR f0reachARR merged commit 09b46d6 into main Apr 23, 2026
2 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a utility for managing callback URLs and integrates it into the login, registration, and invitation flows to maintain user context across authentication steps. A critical issue was identified in the registration hook where the verification callback URL was overwriting the required email verification endpoint; suggestions were provided to correctly append the destination as a parameter instead.

Comment on lines +22 to +24
callbackURL: verificationCallbackUrl
? new URL(verificationCallbackUrl, window.location.origin).toString()
: `${window.location.origin}/auth/verify-email`,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The current implementation replaces the email verification URL entirely with the verificationCallbackUrl. This will break the registration flow because the user will be directed to a page (like /dashboard or /invite/...) that does not handle the email verification token. Instead, the callbackURL sent to the auth provider should point to the verification endpoint, which then handles the redirection to the final destination.

Suggested change
callbackURL: verificationCallbackUrl
? new URL(verificationCallbackUrl, window.location.origin).toString()
: `${window.location.origin}/auth/verify-email`,
callbackURL: verificationCallbackUrl
? appendCallbackUrl(`${window.location.origin}/auth/verify-email`, verificationCallbackUrl)
: `${window.location.origin}/auth/verify-email`,

Comment on lines 4 to +10
import { useInvalidateMe } from '@/contexts/AuthContext';
import { authClient } from '@/lib/auth/client';

export function useRegisterForm(onSuccess: (email: string) => void) {
export function useRegisterForm(
onSuccess: (email: string) => void,
verificationCallbackUrl?: string,
) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Import appendCallbackUrl to correctly construct the email verification URL with the target callback destination.

Suggested change
import { useInvalidateMe } from '@/contexts/AuthContext';
import { authClient } from '@/lib/auth/client';
export function useRegisterForm(onSuccess: (email: string) => void) {
export function useRegisterForm(
onSuccess: (email: string) => void,
verificationCallbackUrl?: string,
) {
import { useInvalidateMe } from '@/contexts/AuthContext';
import { authClient } from '@/lib/auth/client';
import { appendCallbackUrl } from '@/lib/auth/callback-url';
export function useRegisterForm(
onSuccess: (email: string) => void,
verificationCallbackUrl?: string,
) {

@f0reachARR f0reachARR deleted the feature/signup-experience branch April 23, 2026 07:14
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