forked from Open-Source-Chandigarh/Euphoria-Check
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Add-login-and-signup-sahithi000'
- Loading branch information
Showing
8 changed files
with
1,002 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
body{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background-color: aliceblue; | ||
} | ||
img{ | ||
width: 500px; | ||
} | ||
|
||
#login,#signup{ | ||
font-size: 30px; | ||
line-height: 50px; | ||
color: rgba(99, 88, 220, 1); | ||
font-weight: bold; | ||
} | ||
|
||
.container{ | ||
border-radius: 8px; | ||
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.08); | ||
background-color: #fff; | ||
height: 400px; | ||
width: 350px; | ||
margin-left: 100px; | ||
} | ||
.container2{ | ||
border-radius: 8px; | ||
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.08); | ||
background-color: #fff; | ||
height: 400px; | ||
width: 350px; | ||
margin-left: 100px; | ||
} | ||
.input-group{ | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 10px; | ||
} | ||
input,button{ | ||
height: 30px; | ||
width: 80%; | ||
} | ||
button{ | ||
background-color: rgba(99, 88, 220, 1); | ||
color: white; | ||
border: none; | ||
} | ||
#p1{ | ||
margin-left: 80px; | ||
} | ||
|
||
a{ | ||
|
||
text-decoration: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require("dotenv").config() | ||
//MongoDB connection for login and signup | ||
const mongoose=require("mongoose") | ||
const connect=mongoose.connect(process.env.Mongo_URL) | ||
connect.then(()=>{ | ||
console.log("connected to DB successfully") | ||
}) | ||
.catch(()=>{ | ||
console.log("error connecting to DB") | ||
}) | ||
|
||
// Custom email validator function | ||
function validateEmail(email) { | ||
// Regular expression for email validation | ||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; | ||
return emailRegex.test(email); | ||
} | ||
const loginSchema=new mongoose.Schema({ | ||
email:{ | ||
type:String, | ||
required:true, | ||
validate: [validateEmail, 'Please fill a valid email address'] | ||
}, | ||
password:{ | ||
type:String, | ||
required:true | ||
} | ||
}); | ||
const collection=new mongoose.model("users",loginSchema) | ||
module.exports=collection; |
Oops, something went wrong.