Guest User

Untitled

a guest
Jan 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. Error: Cannot find module './lib/mediaType'"
  2.  
  3. successful login authentication
  4.  
  5. module.js:540
  6. throw err;
  7. ^
  8.  
  9. Error: Cannot find module './lib/mediaType'
  10. at Function.Module._resolveFilename (module.js:538:15)
  11. at Function.Module._load (module.js:468:25)
  12. at Module.require (module.js:587:17)
  13. at require (internal/module.js:11:18)
  14.  
  15. at loadModule (D:GitHubjs_exmplsauthenticationnode_modulesnegotiatorindex.js:114:16)
  16.  
  17. at Negotiator.mediaTypes (D:GitHubjs_exmplsauthenticationnode_modulesnegotiatorindex.js:76:29)
  18.  
  19. at Accepts.type.Accepts.types (D:GitHubjs_exmplsauthenticationnode_modulesacceptsindex.js:105:33)
  20.  
  21. at IncomingMessage.req.accepts (D:GitHubjs_exmplsauthenticationnode_modulesexpresslibrequest.js:134:23)
  22.  
  23. at ServerResponse.res.format (D:GitHubjs_exmplsauthenticationnode_modulesexpresslibresponse.js:627:11)
  24.  
  25. at ServerResponse.redirect (D:GitHubjs_exmplsauthenticationnode_modulesexpresslibresponse.js:888:8)
  26.  
  27. at D:GitHubjs_exmplsauthenticationapp.js:113:6
  28.  
  29. at D:GitHubjs_exmplsauthenticationnode_modulespassportlibmiddlewareauthenticate.js:249:29
  30.  
  31. at D:GitHubjs_exmplsauthenticationnode_modulespassportlibhttprequest.js:51:48
  32.  
  33. at D:GitHubjs_exmplsauthenticationnode_modulespassportlibsessionmanager.js:16:14
  34.  
  35. at pass (D:GitHubjs_exmplsauthenticationnode_modulespassportlibauthenticator.js:297:14)
  36.  
  37. at Authenticator.serializeUser (D:GitHubjs_exmplsauthenticationnode_modulespassportlibauthenticator.js:299:5)
  38.  
  39. at SessionManager.logIn (D:GitHubjs_exmplsauthenticationnode_modulespassportlibsessionmanager.js:14:8)
  40.  
  41. at IncomingMessage.req.login.req.logIn (D:GitHubjs_exmplsauthenticationnode_modulespassportlibhttprequest.js
  42. :50:33)
  43.  
  44. at Strategy.strategy.success (D:GitHubjs_exmplsauthenticationnode_modulespassportlibmiddlewareauthenticate.j
  45. s:248:13)
  46.  
  47. at verified (D:GitHubjs_exmplsauthenticationnode_modulespassport-locallibstrategy.js:83:10)
  48.  
  49. at PBKDF2.ondone (D:GitHubjs_exmplsauthenticationnode_modulespassport-local-mongooselibauthenticate.js:48:12))
  50.  
  51. "var mediaType = require('media-type');"
  52.  
  53. var http = require('http');
  54.  
  55. var mongoose = require('mongoose');
  56.  
  57. var mongodb=require('mongodb');
  58.  
  59. var express=require('express');
  60.  
  61. var csv = require('csv');
  62.  
  63. var bodyParser= require('body-parser');
  64.  
  65. var fs = require('fs');
  66.  
  67. var path=require('path');
  68.  
  69. var assert= require('assert');
  70.  
  71. var User= require("./models/user.js");
  72.  
  73. var passport= require('passport');
  74.  
  75. var mediaType = require('media-type');
  76.  
  77. var LocalStrategy= require('passport-local');
  78.  
  79. var passportLocalMongoose= require('passport-local-mongoose');
  80.  
  81. var mongoClient=require('mongoose');
  82.  
  83. var app = express();
  84.  
  85. var Schema = mongoose.Schema;
  86.  
  87. .
  88.  
  89. .
  90.  
  91. app.get('/login', function (req, res) {
  92.  
  93. res.render('login' );
  94.  
  95. })
  96. .
  97.  
  98. .
  99.  
  100.  
  101. app.post("/login",function(req,res,err){
  102.  
  103. if (err) {console.log(err); };//else not needed render is end
  104.  
  105. passport.authenticate("local")(req,res,function(){
  106.  
  107. console.log("successful login authentication");
  108.  
  109. res.redirect("./views/friends.ejs");
  110.  
  111. });
  112.  
  113. })
Add Comment
Please, Sign In to add comment