code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Login Client Component
|
||||
*
|
||||
*
|
||||
* Handles client-side login flow using the LoginFlowController.
|
||||
* Deterministic state machine per docs/architecture/website/LOGIN_FLOW_STATE_MACHINE.md
|
||||
*/
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
import { useAuth } from '@/components/auth/AuthContext';
|
||||
import { LoginFlowController, LoginState } from '@/lib/auth/LoginFlowController';
|
||||
import { LoginViewModelBuilder } from '@/lib/builders/view-models/LoginViewModelBuilder';
|
||||
import { ClientWrapperProps } from '@/lib/contracts/components/ComponentContracts';
|
||||
import { LoginMutation } from '@/lib/mutations/auth/LoginMutation';
|
||||
import { validateLoginForm, type LoginFormValues } from '@/lib/utils/validation';
|
||||
@@ -26,8 +25,13 @@ export function LoginClient({ viewData }: ClientWrapperProps<LoginViewData>) {
|
||||
const { refreshSession, session } = useAuth();
|
||||
|
||||
// Build ViewModel from ViewData
|
||||
const [viewModel, setViewModel] = useState<LoginViewModel>(() =>
|
||||
LoginViewModelBuilder.build(viewData)
|
||||
const [viewModel, setViewModel] = useState<LoginViewModel>(() =>
|
||||
new LoginViewModel(
|
||||
viewData.returnTo,
|
||||
viewData.hasInsufficientPermissions,
|
||||
viewData.formState,
|
||||
{ showPassword: viewData.showPassword, showErrorDetails: viewData.showErrorDetails }
|
||||
)
|
||||
);
|
||||
|
||||
// Login flow controller
|
||||
|
||||
Reference in New Issue
Block a user