68bbbf8895
- 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
9 lines
382 B
TypeScript
9 lines
382 B
TypeScript
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
|
|
}
|