Skip to content

Commit

Permalink
Logout Problem Solved
Browse files Browse the repository at this point in the history
  • Loading branch information
utsavshukla committed Dec 31, 2020
1 parent fe175b4 commit 1fd2c4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions frontend/src/pages/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ class Login extends React.Component {
</div>

</div>



);
}
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/Profile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ class Profile extends React.Component {
const { username, email, password, otp} = this.state.data;
const {errors} = this.state;
console.log("user",userData.user_image);
if(!localStorage.getItem('loggedIn')){
return <Redirect to="/login" />
}
if(localStorage.getItem('loggedIn') === 'false'){
return <Redirect to = {"/login"} />
}

let coverImage;

Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/Register/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class RegisterForm extends React.Component {
console.log(user);
if(loggedIn){
localStorage.setItem('loggedIn', true);
if(!loggedIn){
if(localStorage.getItem('loggedIn') === 'true'){
localStorage.setItem('name',user.userData._id);
}
}
Expand Down Expand Up @@ -191,7 +191,7 @@ class RegisterForm extends React.Component {
<label for="orangeForm-pass">Your password</label>
</div>

<div className="md-form">
{/* <div className="md-form">
<i className="fas fa-lock prefix"></i>
<input
name="password"
Expand All @@ -204,7 +204,7 @@ class RegisterForm extends React.Component {
value = {password}
/>
<label for="orangeForm-pass">Repeat password</label>
</div>
</div> */}

{
this.state.isVerify ?
Expand Down

0 comments on commit 1fd2c4b

Please sign in to comment.