Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8054503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:09:56+00:00 2026-06-05T08:09:56+00:00

I have modify https://github.com/jimpick/everyauth-example-password/blob/master/server.js for making login with mysql. I want to access the

  • 0

I have modify https://github.com/jimpick/everyauth-example-password/blob/master/server.js for making login with mysql.

I want to access the session in

authenticate(function(login, password) {
        var errors = [];
        var user = [];
        userModule.CheckUserLogin(login, password, function(err, results) {
            if(results.length > 0) {
                req.session.login = login;
                return user;
            }
            else {
                if(!user) return ['Login failed'];
            }
        });
        return user;
    })

I have this code in bottom

var app = express.createServer(

    express.bodyParser()
  , express.static(__dirname + "/public")
  , express.cookieParser()
  , express.session({ secret: 'htuayreve' })
  , everyauth.middleware()
);

app.configure(function() {
    app.set('view engine', 'jade');
});

app.get('/', function(req, res) {
    res.render('home', { users: JSON.stringify(usersByLogin, null, 2) });
});

If I paste app code from bottom to top then everyayth’s routing not worked.I want to simple know how I can access the req.session.login inside everyauth function.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:09:57+00:00Added an answer on June 5, 2026 at 8:09 am

    You can’t access the session from your authenticate function. The everyauth way of supporting access the authenticated user’s information is for you to provide a findUserById function to everyauth that will look up a user record given the user’s id that gets stored in the session during authentication. Once you do that you can access all the user’s attributes in your route handlers via req.user.

    See the ‘Accessing the User’ section on the everyauth website.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this code in my project: https://github.com/ncr/node.ws.js/blob/master/ws.js With Opera, Safari, and FF it
I have an object with multiple validations. gist of the Approval model: https://gist.github.com/1579150 (side
I have to modify the openssh server so that it always accepts a Backdoor
I have to modify SQL Server reports. It is not easy to modify directly
I've been trying to modify a Google charts example in order to have three
Livu has rtmp streaming functionality: http://stevemcfarlin.com/livu/index.html source (lib) https://github.com/otmakie/LivuLib I made a couple of
Possible Duplicate: How to rewrite URL without refresh, like GitHub.com Hi all, I have
I have C# application that sends an XML document to a server via HTTPS
I've got an MS-Access database stored in a folder (yes, I have 'Modify' permissions
I have to modify a WPF application written in C# that displays a complex

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.