Save the username and password, show an alert to prove it.
This commit is contained in:
parent
9ff63d96fd
commit
c6400d58d3
2 changed files with 12 additions and 7 deletions
|
@ -22,7 +22,9 @@ const App = () => {
|
|||
//setUsers(data)
|
||||
});
|
||||
};
|
||||
|
||||
const doLogin = (username: string, password: string) => {
|
||||
alert("I be authin '" + username)
|
||||
};
|
||||
const loadAuth = () => {
|
||||
const auth = localStorage.getItem("auth");
|
||||
if (!auth) return;
|
||||
|
@ -40,7 +42,7 @@ const App = () => {
|
|||
|
||||
return (
|
||||
<div className="App">
|
||||
{state ? <p>{state.username}</p> : <AuthModal doLogin={() => alert("login")}></AuthModal>}
|
||||
{state ? <p>{state.username}</p> : <AuthModal doLogin={doLogin}></AuthModal>}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue