Skip to content

Commit

Permalink
Added some comments for routes in user.js iampavangandhi#46
Browse files Browse the repository at this point in the history
  • Loading branch information
fabcodingzest committed Aug 21, 2020
1 parent cb5bc8e commit fadae14
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions routes/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ const { ensureGuest } = require("../../middleware/auth");
// Load User Model
const User = require("../../models/User");

// Sign Up Page
// @desc Sign Up Page
// @route GET /user/signup
// @access Public
router.get('/signup', ensureGuest, (req, res) => {
res.status(200).render('signup', { layout: 'layouts/login' })
})

// Submit Sign Up Form
// @desc Submit Sign Up Form
// @route GET /user/signup
router.post('/signup', (req, res) => {
const { firstName, lastName, password1, password2, email } = req.body;
let errors = [];
Expand Down Expand Up @@ -62,6 +65,8 @@ router.post('/signup', (req, res) => {
}
})

// @desc Submit Sign In Form
// @route GET /user/signin
router.post('/signin', (req, res, next) => {
passport.authenticate('local', {
successRedirect: '/portfolio',
Expand Down

0 comments on commit fadae14

Please sign in to comment.