🌐
GitHub
github.com › BRdhanani › login-registraion-in-react-using-localstorage
GitHub - BRdhanani/login-registraion-in-react-using-localstorage: React Login Registration Form Using LocalStorage
React Login Registration Form Using LocalStorage. Contribute to BRdhanani/login-registraion-in-react-using-localstorage development by creating an account on GitHub.
Forked by 5 users
Languages   JavaScript 81.5% | HTML 12.0% | CSS 6.5% | JavaScript 81.5% | HTML 12.0% | CSS 6.5%
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › react-hook-form-create-basic-reactjs-registration-and-login-form
Basic Registration and Login Form Using React Hook Form - GeeksforGeeks
Form Submission: On form submission, checks if the entered email exists in localStorage. If found, compares the stored password with the entered one.​ · Feedback: Logs appropriate messages to the console based on the login attempt's success ...
Published   September 27, 2025
🌐
YouTube
youtube.com › watch
SignIn and SignUp with localstorage in React JS || Registration form in react js with localstorage - YouTube
In this video, I have explained how to develop signin and signup login with localstorage in react js. I have explained how to use localstorage in react js.#s...
Published   September 16, 2022
🌐
Medium
saurabhnativeblog.medium.com › react-30-project-10-building-user-authentication-forms-using-react-js-and-react-router-1e3f2efa0c3a
React 30-Project 10: Building User Authentication Forms using React.js and React Router | by Saurabh Mhatre | Medium
November 19, 2023 - The logic is similar to registration component. We redirect the user to home page after successive login. ... import React,{ useEffect } from 'react'; import { withRouter } from 'react-router-dom'; import { ACCESS_TOKEN_NAME, API_BASE_URL } ...
🌐
CodeSandbox
codesandbox.io › s › react-login-with-localstorage-rk180
React-Login-with-LocalStorage - CodeSandbox
March 30, 2021 - React-Login-with-LocalStorage by varit05 using axios, react, react-dom, react-router-dom, react-scripts
Published   Mar 30, 2021
Author   varit05
🌐
YouTube
youtube.com › codewithviju
Login & Register in React JS with Local Storage for Beginners (in 37 Minutes Only) | @CodeWithViju - YouTube
Login & Register in React JS with Local Storage for Beginners (in 37 Minutes Only) | @CodeWithViju in this video i show you how you can create Complete Logi...
Published   September 8, 2022
Views   30K
🌐
BezKoder
bezkoder.com › home › react redux login, logout, registration example with hooks
React Redux Login, Logout, Registration example with Hooks - BezKoder
September 27, 2022 - In this tutorial, we’re gonna build a React Redux Login, Logout, Registration example with LocalStorage, React Router, Axios and Bootstrap using React.js Hooks. I will show you: JWT Authentication Flow for User Registration & User Login, Logout · Project Structure for React Redux JWT Authentication, LocalStorage, Router, Axios · Working with Redux Actions, Reducers, Store for Application state · Creating React Function Components with Hooks & Form Validation
Find elsewhere
🌐
i2tutorials
i2tutorials.com › home › blogs › how to store a logged-in user information in local storage in react js
How to Store a logged-in User Information in Local Storage in React JS | i2tutorials
November 5, 2022 - We have also defined a conditional that displays a user.name is logged in message if we have a login user, and the login form if we do not have a user. Next we are creating a handleSubmit function which will be clicked once the user has entered the user name and password. const handleSubmit = async e => { e.preventDefault(); const user = { username, password }; // send the username and password to the server const response = await axios.post( "http://xyz/login", user ); // set the state of the user setUser(response.data) // store the user in localStorage localStorage.setItem('user', response.data) console.log(response.data) };
🌐
YouTube
youtube.com › watch
React JS Login & Registration System with LocalStorage | Step-by-Step Tutorial 2024 - YouTube
In this tutorial, learn how to build a fully functional login and registration system using React JS and LocalStorage. We'll guide you through creating user ...
Published   November 13, 2024
🌐
DEV Community
dev.to › kevhines › using-localstorage-with-react-226m
Using LocalStorage with React - DEV Community
June 7, 2021 - I am working on an application that uses React and Redux and I wanted to add a login page but I didn't have time initially to create a fully secure frontend login. So, as a placeholder I used localStorage to keep track of who was logged in.
🌐
YouTube
youtube.com › watch
Login and Logout with LocalStorage in React JS || Set and Get Email Password in LocalStorage - YouTube
In this video, You will learn how to create a default login page with localstorage in react js. Source code : ( https://github.com/AkajithAk/youtubeReact/tr...
Published   May 20, 2022
🌐
GitHub
gist.github.com › bruce › f55e729d810ed07c86c6dc51bb8c99be
React + Redux + localStorage Login example · GitHub
May 3, 2019 - Clone this repository at <script src="https://gist.github.com/bruce/f55e729d810ed07c86c6dc51bb8c99be.js"></script> Save bruce/f55e729d810ed07c86c6dc51bb8c99be to your computer and use it in GitHub Desktop. Download ZIP · React + Redux + localStorage Login example ·
🌐
GitHub
github.com › hardikk2002 › Register-and-Login-using-LocalStorage-in-React
GitHub - hardikk2002/Register-and-Login-using-LocalStorage-in-React: Sample project on how to work with local storage in Reactjs
Sample project on how to work with local storage in Reactjs - hardikk2002/Register-and-Login-using-LocalStorage-in-React
Starred by 8 users
Forked by 8 users
Languages   JavaScript 85.1% | CSS 13.0% | HTML 1.9% | JavaScript 85.1% | CSS 13.0% | HTML 1.9%
🌐
Reddit
reddit.com › r/learnjavascript › creating register/ login using local storage
r/learnjavascript on Reddit: Creating Register/ Login using Local Storage
September 29, 2018 -

Hi guys,

Working on an assignment where I have to create a user registration & login form that stores data in local storage using HTML5. After hours of searching I really cannot find anything that teaches how to do this. The form is working, an example of how I have it written here:

<label for="fname"></label>

<input type="text" placeholder="First Name" id="fname" name="fname" required="required">

Only issue is I'm unable to get it to store data in localstorage, can anyone help with this please?

I can't use PHP or Databases - I know that would be easier to do, but unfortunately I'm not aloud to.

🌐
GitHub
github.com › Sanskarraj51 › Login
GitHub - Sanskarraj51/Login: Login and Register using react js with Localstorage
Login and Register using react js with Localstorage · Login and Register using react js with Localstorage · Readme · 5 stars · 2 watching · 14 forks · No releases published · No packages published · You can’t perform that action at this time. You signed in with another tab or window.
Starred by 5 users
Forked by 14 users
Top answer
1 of 1
1

you need to give type="submit" to button of your form in order to submit form

  <Button fullWidth type="submit" variant="contained">
                Sign In
              </Button>

if it still not working, use state instead

here what I did with your code :

  const getEmail = localStorage.getItem("emailData")
  const getPassword = localStorage.getItem("passwordData")

  const [values, setValues] = useState({
    email: "",
    pass: "",
    showPass: false,
  });

  const handleSubmit=()=>{
      if(values.email ==="admin" && values.pass ==="admin"){
          localStorage.setItem("emailData","admin")
          localStorage.setItem("passwordData","admin")
      }
  }



const handlePassVisibilty = () => {
  setValues({
    ...values,
    showPass: !values.showPass,
  });
};


  
return (
  
  <div>
      {
      getEmail&&getPassword?<Home/>:
  
      
    <Container maxWidth="sm">
      <Grid
        container
        spacing={2}
        direction="column"
        justifyContent="center"
        style={{ minHeight: "100vh" }}
      >
        <Paper elelvation={2} sx={{ padding: 10 }}>
          <h2>Welcome to Employee Management System</h2>
          <form onSubmit={handleSubmit}>
            <Grid container direction="column" spacing={2}>
              <Grid item>
                <TextField
                  type="text"
                  fullWidth
                  label="Enter your Username"
                  placeholder="Username"
                  variant="outlined"
                  required
                  value={values.email}
                  onChange={(e)=>{
                    setValues(prevState=>({...prevState,email:e.target.value}))
                  }}
            
                />    
              </Grid>

              <Grid item>
                <TextField
                  type={values.showPass ? "text" : "password"}
                  fullWidth
                  label="Enter your Password"
                  placeholder="Password"
                  variant="outlined"
                  required
                  value={values.pass}
                  onChange={(e)=>{
                    setValues(prevState=>({...prevState,pass:e.target.value}))
                  }}
                  InputProps={{
                    endAdornment: (
                      <InputAdornment position="end">
                        <IconButton
                          onClick={handlePassVisibilty}
                          aria-label="toggle password"
                          edge="end"
                        >
                          {values.showPass ? (
                            <VisibilityOffIcon />
                          ) : (
                            <VisibilityIcon />
                          )}
                        </IconButton>
                      </InputAdornment>
                    ),
                  }}
                />
              </Grid>

              <Grid item>
                <Button type="submit" fullWidth variant="contained" >
                  Sign In
                </Button>
              </Grid>
            </Grid>
          </form>
        </Paper>
      </Grid>
    </Container>
}
  </div>

);
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-add-login-authentication-to-react-applications
How To Add Login Authentication to React Applications | DigitalOcean
January 7, 2026 - This tutorial covers sessionStorage and localStorage as modern alternatives to cookies for token storage. Cookies are covered in Step 8 when discussing CSRF protection. To test the benefits of storing outside of memory, convert the in-memory storage to sessionStorage. Open App.js: ... Remove the call to useState and create two new functions called setToken and getToken. Then call getToken and assign the results to a variable called token: ... import React from 'react'; import { BrowserRouter, Route, Routes } from 'react-router-dom'; import './App.css'; import Dashboard from '../Dashboard/Dashboard'; import Login from '../Login/Login'; import Preferences from '../Preferences/Preferences';