Allow redirecting to a different URL when updating the password. This will be useful for thr Waitlist plugin. (#91)
This commit is contained in:
committed by
GitHub
parent
90f25a5ed5
commit
a682b991f3
@@ -17,12 +17,21 @@ export const generateMetadata = async () => {
|
||||
|
||||
const Logo = () => <AppLogo href={''} />;
|
||||
|
||||
async function UpdatePasswordPage() {
|
||||
interface UpdatePasswordPageProps {
|
||||
searchParams: Promise<{
|
||||
callback?: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
async function UpdatePasswordPage(props: UpdatePasswordPageProps) {
|
||||
await requireUserInServerComponent();
|
||||
|
||||
const { callback } = await props.searchParams;
|
||||
const redirectTo = callback ?? pathsConfig.app.home;
|
||||
|
||||
return (
|
||||
<AuthLayoutShell Logo={Logo}>
|
||||
<UpdatePasswordForm redirectTo={pathsConfig.app.home} />
|
||||
<UpdatePasswordForm redirectTo={redirectTo} />
|
||||
</AuthLayoutShell>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ class AuthCallbackService {
|
||||
searchParams.delete('token_hash');
|
||||
searchParams.delete('type');
|
||||
searchParams.delete('next');
|
||||
searchParams.delete('callback');
|
||||
|
||||
// if we have a next path, we redirect to that path
|
||||
if (nextPath) {
|
||||
|
||||
Reference in New Issue
Block a user