Skip to content
Snippets Groups Projects
Commit 76050b83 authored by Trivikram Battalapalli's avatar Trivikram Battalapalli
Browse files

fixed login error

parent e57fc1b4
No related branches found
No related tags found
No related merge requests found
import axios from 'axios';
const client = axios.create({ baseURL: 'http://3.139.131.0:5000/api/' });
// const client = axios.create({ baseURL: 'http://3.139.131.0:5000/api/' });
const client = axios.create({ baseURL: 'http://10.194.199.185:3000/api/' });
export default client;
......@@ -15,6 +15,7 @@ export const createUser = async (userData) => {
export const loginUser = async (loginData) => {
try {
console.log('sending');
const response = await client.post('/users/login', loginData); // Send email and password for login
console.log(response);
return handleSuccess(response);
......
......@@ -28,7 +28,10 @@ function LoginScreen({ navigation }) {
const email_lower = email.toLowerCase();
// Call the API to validate login with email and password
console.log(email_lower, password);
const response = await loginUser({ email_lower, password });
const response = await loginUser({
email: email_lower,
password: password,
});
const user = response;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment