fix(auth): fix AuthForm imports and add sign-up callbackURL
Replace @/src/components/ aliases with @/components/. Add callbackURL support to sign-up page for post-registration redirect. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
137ea0287e
commit
ed6a17fe4b
2 changed files with 23 additions and 3 deletions
20
src/app/[locale]/sign-up/page.tsx
Normal file
20
src/app/[locale]/sign-up/page.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { AuthForm } from '@/components/auth/AuthForm';
|
||||
import { routes } from '@/lib/routes';
|
||||
|
||||
type SignUpPageProps = {
|
||||
searchParams: Promise<{
|
||||
callbackURL?: string | string[];
|
||||
}>;
|
||||
};
|
||||
|
||||
export default async function SignUpPage({ searchParams }: SignUpPageProps) {
|
||||
const params = await searchParams;
|
||||
const callbackURL = Array.isArray(params.callbackURL)
|
||||
? params.callbackURL[0]
|
||||
: params.callbackURL;
|
||||
const redirectPath = callbackURL?.startsWith('/')
|
||||
? callbackURL
|
||||
: routes.private.dashboard;
|
||||
|
||||
return <AuthForm mode="sign-up" redirectPath={redirectPath} />;
|
||||
}
|
||||
|
|
@ -26,17 +26,17 @@ import {
|
|||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from '@/src/components/ui/card';
|
||||
} from '@/components/ui/card';
|
||||
import {
|
||||
InputGroup,
|
||||
InputGroupAddon,
|
||||
InputGroupInput,
|
||||
} from '@/src/components/ui/input-group';
|
||||
} from '@/components/ui/input-group';
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from '@/src/components/ui/tooltip';
|
||||
} from '@/components/ui/tooltip';
|
||||
|
||||
import { Spinner } from '../ui/spinner';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue