Skip to content

Commit

Permalink
adD
Browse files Browse the repository at this point in the history
  • Loading branch information
vivitruong committed Mar 15, 2024
1 parent 7bedd57 commit 6f99b5b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class Config:
# so the connection uri must be updated here (for production)
SQLALCHEMY_DATABASE_URI = os.environ.get(
'DATABASE_URL').replace('postgres://', 'postgresql://')
SQLALCHEMY_ECHO = True
SQLALCHEMY_ECHO = True
42 changes: 42 additions & 0 deletions react-app/src/components/auth/LoginForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import {login} from '../../store/session';
import SignUpForm from './SignUpForm';
import '../CSS/LoginForm.css';


const LoginForm = ({setShowSignIn}) => {
const [errors, setErrors] = useState([]);
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const dispatch = useDispatch();

const [showRegister, setShowRegister] = useState(false)

const onLogin = async (e) => {
e.preventDefault();
const data = await dispatch(login(email, password));
if ( data ) {
setErrors(data);

} else {
setShowSignIn(false)
}
}
const updateEmail = e => {
setEmail(e.target.value)
}

const updatePassword = e => {
setPassword(e.target.value)
}

const handleRegister = () => {
setShowRegister(true)
}

return (
<>
</>
)
}

0 comments on commit 6f99b5b

Please sign in to comment.