Skip to content

Commit

Permalink
Merge pull request #1072 from 2004vivek/main
Browse files Browse the repository at this point in the history
Issue #944 Navigating issue even if the user is logged in to website
  • Loading branch information
Apoorva57 authored Oct 28, 2024
2 parents 39acf09 + f1c58b7 commit 7b90dd8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 46 deletions.
74 changes: 28 additions & 46 deletions pages/login-signup/login-signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,20 @@
<a href="#" onclick="openModal()">Forgot Password?</a>
</div>
<button type="submit" class="btn" id="login-btn">Login</button>
<button type="submit" class="btn1" id="login-btn" style=" background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTcuNiA5LjJsLS4xLTEuOEg5djMuNGg0LjhDMTMuNiAxMiAxMyAxMyAxMiAxMy42djIuMmgzYTguOCA4LjggMCAwIDAgMi42LTYuNnoiIGZpbGw9IiM0Mjg1RjQiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik05IDE4YzIuNCAwIDQuNS0uOCA2LTIuMmwtMy0yLjJhNS40IDUuNCAwIDAgMS04LTIuOUgxVjEzYTkgOSAwIDAgMCA4IDV6IiBmaWxsPSIjMzRBODUzIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNNCAxMC43YTUuNCA1LjQgMCAwIDEgMC0zLjRWNUgxYTkgOSAwIDAgMCAwIDhsMy0yLjN6IiBmaWxsPSIjRkJCQzA1IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNOSAzLjZjMS4zIDAgMi41LjQgMy40IDEuM0wxNSAyLjNBOSA5IDAgMCAwIDEgNWwzIDIuNGE1LjQgNS40IDAgMCAxIDUtMy43eiIgZmlsbD0iI0VBNDMzNSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PHBhdGggZD0iTTAgMGgxOHYxOEgweiIvPjwvZz48L3N2Zz4=); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;"><a href="https://accounts.google.com/v3/signin/identifier?authuser=0&continue=https%3A%2F%2Fmyaccount.google.com%2F&ec=GAlAwAE&hl=en_GB&service=accountsettings&flowName=GlifWebSignIn&flowEntry=AddSession&dsh=S1527110508%3A1729760212648495&ddm=0">Login With Google</a></button>
<button type="submit" class="btn2" id="login-btn" style=" background-image: url(https://cdn.freebiesupply.com/logos/large/2x/facebook-logo-2019.png); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;"><a href="https://www.facebook.com/login/">Login With Facebook</button>
<div class="success" id="login-success">Login successful!</div>

<button type="submit" class="btn3" id="login-btn" style=" background-image: url(https://upload.wikimedia.org/wikipedia/commons/5/57/X_logo_2023_%28white%29.png); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;"><a href="https://x.com/i/flow/login">Login With X</button>
<div class="success" id="login-success">Login successful!</div>
<button type="button" class="btn1" id="google-login-btn" style="background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTcuNiA5LjJsLS4xLTEuOEg5djMuNGg0LjhDMTMuNiAxMiAxMyAxMyAxMiAxMy42djIuMmgzYTguOCA4LjggMCAwIDAgMi42LTYuNnoiIGZpbGw9IiM0Mjg1RjQiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik05IDE4YzIuNCAwIDQuNS0uOCA2LTIuMmwtMy0yLjJhNS40IDUuNCAwIDAgMS04LTIuOUgxVjEzYTkgOSAwIDAgMCA4IDV6IiBmaWxsPSIjMzRBODUzIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNNCAxMC43YTUuNCA1LjQgMCAwIDEgMC0zLjRWNUgxYTkgOSAwIDAgMCAwIDhsMy0yLjN6IiBmaWxsPSIjRkJCQzA1IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNOSAzLjZjMS4zIDAgMi41LjQgMy40IDEuM0wxNSAyLjNBOSA5IDAgMCAwIDEgNWwzIDIuNGE1LjQgNS40IDAgMCAxIDUtMy43eiIgZmlsbD0iI0VBNDMzNSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PHBhdGggZD0iTTAgMGgxOHYxOEgweiIvPjwvZz48L3N2Zz4=); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;">
<a href="https://accounts.google.com/v3/signin/identifier?authuser=0&continue=https%3A%2F%2Fmyaccount.google.com%2F&ec=GAlAwAE&hl=en_GB&service=accountsettings&flowName=GlifWebSignIn&flowEntry=AddSession&dsh=S1527110508%3A1729760212648495&ddm=0">Login With Google</a>
</button>

<button type="button" class="btn2" id="facebook-login-btn" style="background-image: url(https://cdn.freebiesupply.com/logos/large/2x/facebook-logo-2019.png); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;">
<a href="https://www.facebook.com/login/">Login With Facebook</a>
</button>

<button type="button" class="btn3" id="x-login-btn" style="background-image: url(https://upload.wikimedia.org/wikipedia/commons/5/57/X_logo_2023_%28white%29.png); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;">
<a href="https://x.com/i/flow/login">Login With X</a>
</button>

<div class="success" id="login-success">Login successful!</div>
</form>
</div>
<div class="tab-content" id="signup">
Expand All @@ -75,10 +83,7 @@
<i class="fa fa-user icon"></i> <!-- User icon -->
Name
</label>
<input type="text" id="signup-name" placeholder="Enter your name" required
pattern="[a-zA-Z ]+"
oninvalid="this.setCustomValidity('Numbers and Symbols are not allowed')"
oninput="this.setCustomValidity('')">
<input type="text" id="signup-name" placeholder="Enter your name" required pattern="[a-zA-Z ]+" oninvalid="this.setCustomValidity('Numbers and Symbols are not allowed')" oninput="this.setCustomValidity('')">
</div>
<div class="form-group">
<label for="login-email">
Expand All @@ -102,53 +107,30 @@
<i class="fa fa-lock icon"></i> <!-- Lock icon -->
Confirm Password
</label>

<input type="password" id="signup-confirm-password" placeholder="Confirm your password"
required>
<i class="fas fa-eye toggle-password"
onclick="togglePassword('signup-confirm-password')"></i>
<input type="password" id="signup-confirm-password" placeholder="Confirm your password" required>
<i class="fas fa-eye toggle-password" onclick="togglePassword('signup-confirm-password')"></i>
<div class="error" id="signup-confirm-password-error"></div>
</div>
<button type="submit" class="btn" id="signup-btn">Sign Up</button>
<button type="submit" class="btn1" id="login-btn" style=" background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTcuNiA5LjJsLS4xLTEuOEg5djMuNGg0LjhDMTMuNiAxMiAxMyAxMyAxMiAxMy42djIuMmgzYTguOCA4LjggMCAwIDAgMi42LTYuNnoiIGZpbGw9IiM0Mjg1RjQiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik05IDE4YzIuNCAwIDQuNS0uOCA2LTIuMmwtMy0yLjJhNS40IDUuNCAwIDAgMS04LTIuOUgxVjEzYTkgOSAwIDAgMCA4IDV6IiBmaWxsPSIjMzRBODUzIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNNCAxMC43YTUuNCA1LjQgMCAwIDEgMC0zLjRWNUgxYTkgOSAwIDAgMCAwIDhsMy0yLjN6IiBmaWxsPSIjRkJCQzA1IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNOSAzLjZjMS4zIDAgMi41LjQgMy40IDEuM0wxNSAyLjNBOSA5IDAgMCAwIDEgNWwzIDIuNGE1LjQgNS40IDAgMCAxIDUtMy43eiIgZmlsbD0iI0VBNDMzNSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PHBhdGggZD0iTTAgMGgxOHYxOEgweiIvPjwvZz48L3N2Zz4=); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;"><a href="https://accounts.google.com/v3/signin/identifier?authuser=0&continue=https%3A%2F%2Fmyaccount.google.com%2F&ec=GAlAwAE&hl=en_GB&service=accountsettings&flowName=GlifWebSignIn&flowEntry=AddSession&dsh=S1527110508%3A1729760212648495&ddm=0">Login With Google</a></button>
<button type="submit" class="btn2" id="login-btn" style=" background-image: url(https://cdn.freebiesupply.com/logos/large/2x/facebook-logo-2019.png); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;"><a href="https://www.facebook.com/login/">Login With Facebook</button>
<div class="success" id="login-success">Login successful!</div>

<button type="submit" class="btn3" id="login-btn" style=" background-image: url(https://upload.wikimedia.org/wikipedia/commons/5/57/X_logo_2023_%28white%29.png); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;"><a href="https://x.com/i/flow/login">Login With X</button>
<button type="button" class="btn1" id="google-signup-btn" style="background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTcuNiA5LjJsLS4xLTEuOEg5djMuNGg0LjhDMTMuNiAxMiAxMyAxMyAxMiAxMy42djIuMmgzYTguOCA4LjggMCAwIDAgMi42LTYuNnoiIGZpbGw9IiM0Mjg1RjQiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik05IDE4YzIuNCAwIDQuNS0uOCA2LTIuMmwtMy0yLjJhNS40IDUuNCAwIDAgMS04LTIuOUgxVjEzYTkgOSAwIDAgMCA4IDV6IiBmaWxsPSIjMzRBODUzIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNNCAxMC43YTUuNCA1LjQgMCAwIDEgMC0zLjRWNUgxYTkgOSAwIDAgMCAwIDhsMy0yLjN6IiBmaWxsPSIjRkJCQzA1IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNOSAzLjZjMS4zIDAgMi41LjQgMy40IDEuM0wxNSAyLjNBOSA5IDAgMCAwIDEgNWwzIDIuNGE1LjQgNS40IDAgMCAxIDUtMy43eiIgZmlsbD0iI0VBNDMzNSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PHBhdGggZD0iTTAgMGgxOHYxOEgweiIvPjwvZz48L3N2Zz4=); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;">
<a href="https://accounts.google.com/v3/signin/identifier?authuser=0&continue=https%3A%2F%2Fmyaccount.google.com%2F&ec=GAlAwAE&hl=en_GB&service=accountsettings&flowName=GlifWebSignIn&flowEntry=AddSession&dsh=S1527110508%3A1729760212648495&ddm=0">Sign Up With Google</a>
</button>

<button type="button" class="btn2" id="facebook-signup-btn" style="background-image: url(https://cdn.freebiesupply.com/logos/large/2x/facebook-logo-2019.png); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;">
<a href="https://www.facebook.com/login/">Sign Up With Facebook</a>
</button>

<button type="button" class="btn3" id="x-signup-btn" style="background-image: url(https://upload.wikimedia.org/wikipedia/commons/5/57/X_logo_2023_%28white%29.png); background-repeat: no-repeat; background-position: 20% 50%; background-size: 30px;">
<a href="https://x.com/i/flow/login">Sign Up With X</a>
</button>
<div class="success" id="signup-success">Signup successful!</div>
</form>
<div class="already-have-account">
<a href="#" onclick="switchToLogin()">Already have an account? Login</a>
</div>
</div>
</div>
<div class="card-footer">
<p>By continuing, you agree to our Terms of Service and Privacy Policy</p>
</div>
</div>

<!-- Password Recovery Modal -->
<div id="passwordRecoveryModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal()">&times;</span>
<h2>Password Recovery</h2>
<form id="password-recovery-form">
<div class="form-group">
<label for="recovery-email">Email</label>
<input type="email" id="recovery-email" placeholder="Enter your email" required>
<div class="error" id="recovery-email-error"></div>
</div>
<button type="submit" class="btn">Send Recovery Email</button>
<div class="success" id="recovery-success">Recovery email sent!</div>
</form>
</div>
</div>
</div>
<!-- Success message container -->
<div id="signup-success-message" class="success-message">Your account was created successfully. Please login to
access the website</div>

<script src="login-signup.js"></script>
</body>

</html>
</html>
1 change: 1 addition & 0 deletions pages/login-signup/login-signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ document.getElementById('login-form').addEventListener('submit', async (event) =
successMessage.style.transition = 'opacity 0.5s';
}, 50);
localStorage.setItem('isLoggedIn', 'true'); // Store login status
window.location.href="/"
setTimeout(() => {
successMessage.style.display = 'none';
const urlParams = new URLSearchParams(window.location.search);
Expand Down

0 comments on commit 7b90dd8

Please sign in to comment.