Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error: Cannot find module './lib/mediaType'"
- successful login authentication
- module.js:540
- throw err;
- ^
- Error: Cannot find module './lib/mediaType'
- at Function.Module._resolveFilename (module.js:538:15)
- at Function.Module._load (module.js:468:25)
- at Module.require (module.js:587:17)
- at require (internal/module.js:11:18)
- at loadModule (D:GitHubjs_exmplsauthenticationnode_modulesnegotiatorindex.js:114:16)
- at Negotiator.mediaTypes (D:GitHubjs_exmplsauthenticationnode_modulesnegotiatorindex.js:76:29)
- at Accepts.type.Accepts.types (D:GitHubjs_exmplsauthenticationnode_modulesacceptsindex.js:105:33)
- at IncomingMessage.req.accepts (D:GitHubjs_exmplsauthenticationnode_modulesexpresslibrequest.js:134:23)
- at ServerResponse.res.format (D:GitHubjs_exmplsauthenticationnode_modulesexpresslibresponse.js:627:11)
- at ServerResponse.redirect (D:GitHubjs_exmplsauthenticationnode_modulesexpresslibresponse.js:888:8)
- at D:GitHubjs_exmplsauthenticationapp.js:113:6
- at D:GitHubjs_exmplsauthenticationnode_modulespassportlibmiddlewareauthenticate.js:249:29
- at D:GitHubjs_exmplsauthenticationnode_modulespassportlibhttprequest.js:51:48
- at D:GitHubjs_exmplsauthenticationnode_modulespassportlibsessionmanager.js:16:14
- at pass (D:GitHubjs_exmplsauthenticationnode_modulespassportlibauthenticator.js:297:14)
- at Authenticator.serializeUser (D:GitHubjs_exmplsauthenticationnode_modulespassportlibauthenticator.js:299:5)
- at SessionManager.logIn (D:GitHubjs_exmplsauthenticationnode_modulespassportlibsessionmanager.js:14:8)
- at IncomingMessage.req.login.req.logIn (D:GitHubjs_exmplsauthenticationnode_modulespassportlibhttprequest.js
- :50:33)
- at Strategy.strategy.success (D:GitHubjs_exmplsauthenticationnode_modulespassportlibmiddlewareauthenticate.j
- s:248:13)
- at verified (D:GitHubjs_exmplsauthenticationnode_modulespassport-locallibstrategy.js:83:10)
- at PBKDF2.ondone (D:GitHubjs_exmplsauthenticationnode_modulespassport-local-mongooselibauthenticate.js:48:12))
- "var mediaType = require('media-type');"
- var http = require('http');
- var mongoose = require('mongoose');
- var mongodb=require('mongodb');
- var express=require('express');
- var csv = require('csv');
- var bodyParser= require('body-parser');
- var fs = require('fs');
- var path=require('path');
- var assert= require('assert');
- var User= require("./models/user.js");
- var passport= require('passport');
- var mediaType = require('media-type');
- var LocalStrategy= require('passport-local');
- var passportLocalMongoose= require('passport-local-mongoose');
- var mongoClient=require('mongoose');
- var app = express();
- var Schema = mongoose.Schema;
- .
- .
- app.get('/login', function (req, res) {
- res.render('login' );
- })
- .
- .
- app.post("/login",function(req,res,err){
- if (err) {console.log(err); };//else not needed render is end
- passport.authenticate("local")(req,res,function(){
- console.log("successful login authentication");
- res.redirect("./views/friends.ejs");
- });
- })
Add Comment
Please, Sign In to add comment