Merge pull request #10 from leomurca/feature/create_test_users

Criar usuários específicos para possibilitar o login (para teste)
This commit is contained in:
Leonardo Murça 2022-09-29 18:23:30 -03:00 committed by GitHub
commit a83de07874
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,8 +22,7 @@ function AuthProvider(props) {
const register = data => { const register = data => {
setState({ ...state, status: 'pending' }); setState({ ...state, status: 'pending' });
let shouldFail = let shouldFail = false;
data.email !== 'leo@gmail.com' && data.password !== '#leo1234';
return registerUser(data, shouldFail).then(data => { return registerUser(data, shouldFail).then(data => {
if (shouldFail) { if (shouldFail) {
@ -36,7 +35,7 @@ function AuthProvider(props) {
const login = (email, password) => { const login = (email, password) => {
setState({ ...state, status: 'pending' }); setState({ ...state, status: 'pending' });
let shouldFail = email !== 'leo@gmail.com' && password !== '#leo1234'; let shouldFail = email !== 'teste@teste.com' || password !== '#teste1234';
return getUser(shouldFail).then(data => { return getUser(shouldFail).then(data => {
if (shouldFail) { if (shouldFail) {