Skip to content

Commit

Permalink
Added Verify email
Browse files Browse the repository at this point in the history
^
  • Loading branch information
Ben Sanderson committed Oct 2, 2024
1 parent 723be32 commit 4c4fa62
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<ul class="dropdown-menu" id="user-dropdown-menu">
<li><a href="#">Discussions</a></li>
<li><a href="#">Account</a></li>
<li><a href="verify-email.html">Verify Email</a></li>
<li><a href="logout.html">Logout</a></li>
</ul>
</li>
Expand Down
60 changes: 60 additions & 0 deletions register.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register</title>
<link rel="stylesheet" href="loginreg.css">
</head>
<body>
<div class="wrapper register">
<h1>Join Pageturners!</h1>
<p>Sign up and be a part of our book-loving community!</p>
<form id="signup-form">
<input type="email" id="email" placeholder="Enter your email" required>
<input type="password" id = "password" placeholder="Create a password" required>
<button type="submit" class="register">Register</button>
</form>


<div class="not-member">
Already a member? <a href="login.html">Login here</a>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/10.13.2/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.13.2/firebase-firestore-compat.js"></script>
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.13.2/firebase-app.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/10.13.2/firebase-analytics.js";
import {getAuth } from "https://www.gstatic.com/firebasejs/10.13.2/firebase-auth.js";
import firebase from "firebase/compat/app";
// Required for side-effects
import "firebase/firestore";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyAt-SInlPaL2FzwtXrRltIEiV5l8k5HMjg",
authDomain: "pageturners-a831a.firebaseapp.com",
projectId: "pageturners-a831a",
storageBucket: "pageturners-a831a.appspot.com",
messagingSenderId: "304224952392",
appId: "1:304224952392:web:f33dbc84b481e39a44787d",
measurementId: "G-C6DKQSJ1R8"
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);

const auth = getAuth(app);
const db = getFirestore(app);


</script>
<script type="module" src="scripts/auth1.js"> </script>
</body>
</html>
1 change: 1 addition & 0 deletions verify-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ <h1>Check Your Email</h1>
if (user) {
user.sendEmailVerification().then(() => {
alert("Verification email resent. Please check your inbox.");
window.location.href = "./dashboard.html";
}).catch(error => {
alert("Error resending verification email: " + error.message);
});
Expand Down

0 comments on commit 4c4fa62

Please sign in to comment.