Skip to content

Commit

Permalink
obscured password input
Browse files Browse the repository at this point in the history
  • Loading branch information
flbarfield committed Oct 9, 2023
1 parent e7208e4 commit 9eba56c
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 17 deletions.
6 changes: 3 additions & 3 deletions controllers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ const User = require('../models/User')
gmail_remove_dots: false
});

// const existingUser = await User.findOne({
// $or: [{ email: req.body.email }, { userName: req.body.userName }]
// });
const existingUser = await User.findOne({
$or: [{ email: req.body.email }, { userName: req.body.userName }]
});

if (existingUser) {
req.flash("errors", {
Expand Down
69 changes: 69 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
"connect-mongo": "^5.0.0",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"ejs": "^3.1.9",
Expand Down
4 changes: 4 additions & 0 deletions public/assets/css/fitnessApp.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ footer a {
flex-direction: column;
}

.exerciseButtons {
cursor: pointer;
}

/* Ending App Actions */
.appActions {
justify-content: space-between;
Expand Down
28 changes: 22 additions & 6 deletions public/assets/js/fitnessApp.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
// Unhiding Sections

// document.querySelectorAll('.fa-note-sticky').addEventListener('click', showNotes)
// document.querySelectorAll('.fa-stopwatch').addEventListener('click', showTimer)

// function showNotes () {
// document.
// }
function showNotes () {
//TODO
}

function showTimer() {
// TODO
}

// function showTimer() {
// Date setting
// function setDate () {
// const [date] = formatDate(new Date()).split(' ')
// const dateInputValue = document.getElementById('date')

// dateInputValue.value = date
// }


// header quote generation


// dateInputValue = date

// Header quote generation //

async function quoteApiRequest() {
try {
let res = await fetch('https://api.kanye.rest')
Expand All @@ -29,4 +44,5 @@ async function quoteApiRequest() {

}

quoteApiRequest()
quoteApiRequest()
// setDate()
20 changes: 16 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,46 @@ const app = express()
const mongoose = require('mongoose')
const passport = require('passport')
const session = require('express-session')
// const MongoStore = require('connect-mongo')(session)
// const MongoStore = require("connect-mongo")
const methodOverride = require('method-override')
const flash = require('express-flash')
const logger = require('morgan')
const connectDB = require('./config/database')
const homeRoutes = require('./routes/home')
const fitnessRoute = require('./routes/fitnessApp')


//Use .env file in config folder
require('dotenv').config({path: './config/.env'})

// Passport config
require('./config/passport')(passport)

//Connect To Database
connectDB()

//Using EJS for views
app.set('view engine', 'ejs')

//Static Folder
app.use(express.static('public'))

//Body Parsing
app.use(express.urlencoded({extended:true}))
app.use(express.json())

//Logging
app.use(logger('dev'))

//Use forms for put / delete
app.use(methodOverride("_method"));

//Sessions
// Sessions - stored in MongoDB
app.use(
session({
secret: 'keyboard cat',
resave: false,
saveUninitialized: false,
// store: new MongoStore({ mongooseConnection: mongoose.connection }),
// store: new MongoStore({ mongooseConnection: mongoose.connection })
})
)

Expand Down
2 changes: 1 addition & 1 deletion views/fitnessApp.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<section id="content" class="main fitnessBody">
<span class="image main"><img class="fitnessAppImg" src="images/trainingPlaceholderLarge.jpg" alt="" /></span>
<section class="date">
<input type="date">
<input id='date' type="date" >
</section>
<section class='exerciseList'>
<% exercises.forEach( el => { %>
Expand Down
6 changes: 3 additions & 3 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<label>Email</label>
<input type="text" name="userName">
<label>Username</label>
<input type="text" name="password">
<input type="password" name="password">
<label>Password</label>
<input type="submit">
<% if (locals.messages.errors) { %>
Expand All @@ -78,9 +78,9 @@
<label>Email</label>
<input type="text" name="userName">
<label>Username</label>
<input type="text" name="password">
<input type="password" name="password">
<label>Password</label>
<input type="text" name="confirmPassword">
<input type="password" name="confirmPassword">
<label>Type your password again.</label>
<input type="submit">
<% if (locals.messages.errors) { %>
Expand Down

0 comments on commit 9eba56c

Please sign in to comment.