ultisuite-client/components/auth/login-page-content.tsx
R3D347HR4Y de5b5a60ef
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
feat: enhance authentication and password reset flows with new components and layout
- Replaced LoginForm with LoginPageContent for improved login handling and user experience.
- Introduced ResetPasswordPage and ResetPasswordLayout components to facilitate password reset functionality.
- Added new flow stages for authentication, including PasswordStage and SourceOAuthStage, to streamline user interactions.
- Updated FlowChallengeForm to integrate new stages and improve error handling during authentication processes.
- Refactored existing components to support the new authentication flow structure, enhancing maintainability and user experience.
2026-06-20 01:09:30 +02:00

56 lines
1.7 KiB
TypeScript

"use client"
import Link from "next/link"
import { AuthFlowPage } from "@/components/auth/auth-flow-page"
import { AUTH_FLOW_SLUGS } from "@/lib/auth/auth-flow-slugs"
type LoginPageContentProps = {
returnTo?: string
error?: string | null
}
export function LoginPageContent({
returnTo = "/mail/inbox",
error = null,
}: LoginPageContentProps) {
const signupHref = `/signup?returnTo=${encodeURIComponent(returnTo)}`
const forgotPasswordHref = `/forgot-password?returnTo=${encodeURIComponent(returnTo)}`
const oidcFallbackHref = `/api/auth/login?returnTo=${encodeURIComponent(returnTo)}`
return (
<AuthFlowPage
slug={AUTH_FLOW_SLUGS.authentication}
flowQuery={undefined}
defaultTitle="Connexion"
defaultDescription="Connecte-toi avec ton compte UltiSpace pour accéder à ta suite."
successTitle="Connexion réussie"
successDescription="Redirection vers votre espace…"
successActionLabel="Continuer"
successHref={returnTo}
bridgeAuthentication
returnTo={returnTo}
initialError={error}
footer={
<div className="flex w-full flex-col gap-3 text-center text-sm text-muted-foreground">
<p>
<a className="font-medium text-primary underline" href={oidcFallbackHref}>
Connexion via redirect UltiSpace
</a>
</p>
<p>
Pas encore de compte ?{" "}
<Link className="font-medium text-primary underline" href={signupHref}>
Créer un compte
</Link>
</p>
<p>
<Link className="font-medium text-primary underline" href={forgotPasswordHref}>
Mot de passe oublié ?
</Link>
</p>
</div>
}
/>
)
}