Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

337
Views
How to control flow based on if user is logged in or not?
APP.GET('/', isLoggedIn, function(req, res) { if (isLoggedIn){res.render(index-authed) else { res.render(index)} });

how do i check what isLoggedIn returns? so i can handle flow like this?

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

From what I can understand from your question, in order to check what isLoggedIn returns, you can do that by a simple console.log like this:

console.log(isLoggedIn);

If you're using connect/express, it should return a Boolean.

about 4 years ago · Santiago Trujillo Report

0

You can pass loggedIn status in your req object

in loggedIn function try adding following:

req.loggedIn = true;

and then in your next middleware function you can access req.loggedIn

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!