@ha_tecno/react-native-sdk
Version:
React Native SDK for biometric authentication, liveness detection, and fingerprint recognition
22 lines (18 loc) • 722 B
text/typescript
import { api } from '../http/api';
export const userService = {
validCpf: (cpf: string) =>
api.post('/validcpf', { cpf }).catch((error) => ({
status: error?.status || 400,
message: error?.message || 'CPF inválido ou não cadastrado',
})),
login: (cpf: string, password: string) =>
api.post('/login', { cpf, senha: password }).catch((error) => ({
status: error?.status || 400,
message: error?.message || 'CPF ou senha inválidos',
})),
register: (cpf: string, name: string, password: string) =>
api.post('/signup', { cpf, name, senha: password }).catch((error) => ({
status: error?.status || 400,
message: error?.message || 'Erro ao cadastrar',
})),
};