forked from React-Group/interstellar_ai
main #32
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
|
||||||
import {
|
import {
|
||||||
createAccount,
|
createAccount,
|
||||||
checkCredentials,
|
checkCredentials,
|
||||||
|
getData
|
||||||
} from '../backend/database';
|
} from '../backend/database';
|
||||||
import Settings from './settings/Settings'; // Import the Settings component
|
import Settings from './settings/Settings'; // Import the Settings component
|
||||||
|
|
||||||
|
@ -54,6 +55,10 @@ const Login: React.FC = () => {
|
||||||
const success = await checkCredentials(accountName, password);
|
const success = await checkCredentials(accountName, password);
|
||||||
if (success) {
|
if (success) {
|
||||||
setIsLoggedIn(true); // Successful login
|
setIsLoggedIn(true); // Successful login
|
||||||
|
var data = await getData(accountName, password)
|
||||||
|
if (data) {
|
||||||
|
localStorage.setItem("dataFromServer", data)
|
||||||
|
}
|
||||||
setShowLoginPopup(false); // Close the login popup
|
setShowLoginPopup(false); // Close the login popup
|
||||||
} else {
|
} else {
|
||||||
alert('Incorrect credentials');
|
alert('Incorrect credentials');
|
||||||
|
|
Loading…
Reference in a new issue