refactor(auth): extract AuthPasswordForm and AuthCodeForm to features

- Create auth-password feature with login/register form
- Create auth-code feature with email+code verification form
- Extract getApiErrorMessage to shared lib
- Simplify AuthPage to pure UI composer with tabs
- Update tests for new component structure
- All 40 tests passing
This commit is contained in:
Kirill
2026-05-22 14:36:19 +05:00
parent da13ce2848
commit 68bbbf8895
9 changed files with 461 additions and 379 deletions
@@ -0,0 +1,8 @@
export function getApiErrorMessage(err: unknown): string | null {
if (!err || typeof err !== 'object') return null
const anyErr = err as Record<string, unknown>
const response = anyErr.response as Record<string, unknown> | undefined
const data = response?.data as Record<string, unknown> | undefined
const msg = data?.error
return typeof msg === 'string' ? msg : null
}