diff --git a/FrontEnd/index.html b/FrontEnd/index.html index 8873717..de4118a 100644 --- a/FrontEnd/index.html +++ b/FrontEnd/index.html @@ -5,6 +5,9 @@ + + + Virtual TA diff --git a/FrontEnd/src/App.css b/FrontEnd/src/App.css index 53fb46a..7dd4b90 100644 --- a/FrontEnd/src/App.css +++ b/FrontEnd/src/App.css @@ -35,7 +35,7 @@ .navbar-cap-2 { margin: 0; font-size: 20px; - margin-top: 40px; + margin-top: 30px; width: fit-content; margin-left: auto; margin-right: auto; diff --git a/FrontEnd/src/App.jsx b/FrontEnd/src/App.jsx index ce19835..cf2f71c 100644 --- a/FrontEnd/src/App.jsx +++ b/FrontEnd/src/App.jsx @@ -8,6 +8,7 @@ export default function App() { } /> + } /> ); } \ No newline at end of file diff --git a/FrontEnd/src/Home.jsx b/FrontEnd/src/Home.jsx index 34d8683..8d8fd7f 100644 --- a/FrontEnd/src/Home.jsx +++ b/FrontEnd/src/Home.jsx @@ -3,6 +3,7 @@ import TextBox2 from './components/TextBox2'; import Sessions from './components/SessionBar'; import Navbar from './components/Navbar'; export default function Home() { + function toggleSessions(){ var sessionContainer = document.querySelector('.session-container'); var chatContainer = document.querySelector('.chat-container'); diff --git a/FrontEnd/src/Login.jsx b/FrontEnd/src/Login.jsx index 08cbadc..817fe63 100644 --- a/FrontEnd/src/Login.jsx +++ b/FrontEnd/src/Login.jsx @@ -13,33 +13,39 @@ export default function Login() { const [password, setPassword] = useState(''); - // async function authorizeUser() { - // try{ - // var credentials = JSON.stringify({ - // "username": username, - // "password": password - // }); - // var myHeaders = new Headers(); - // myHeaders.append("Content-Type", "application/json"); - - var requestOptions = { + async function authorizeUser() { + try { + const credentials = JSON.stringify({ + username, + password + }); + const myHeaders = { + "Content-Type": "application/json" + }; + + const requestOptions = { method: 'POST', headers: myHeaders, body: credentials, redirect: 'follow', - credentials: 'include' //Make sure to have this line for every Request. Or else the cookie won't be included in the requests + credentials: 'include' }; - const response = fetch("http://18.189.195.246:443/auth/login", requestOptions); + + const response = await fetch("http://18.189.195.246:443/auth/login", requestOptions); + if (response.ok) { - navigator('home'); - } - else { + navigator('/home'); + } else { alert('Invalid Credentials'); } + } catch (err) { + alert(err.message); + } + } + return ( -
+
- - ) } diff --git a/FrontEnd/tailwind.config.js b/FrontEnd/tailwind.config.js index 80fdaf9..d78c363 100644 --- a/FrontEnd/tailwind.config.js +++ b/FrontEnd/tailwind.config.js @@ -7,7 +7,7 @@ export default { theme: { extend: { fontFamily: { - sans: ['PT Serif', 'Roboto', 'sans-serif'], + sans: ['PT Sans', 'PT Serif', 'Roboto', 'sans-serif'], }, }, },