[Node.js] If logged in, if not.

Asked 2 years ago, Updated 2 years ago, 34 views

Hi, everyone.

Recently, I've been implementing a page with node.js.

If I log in this part, I want to change it to log out.

I have no idea how. The advice to use cookies didn't help much.

I am using passport for session management now. I've implemented both the membership registration and login functions Even if I log in, that login window is still displayed...

Or, if a non-member accesses the page, I would like to make it invisible to the member information and other related matters, unlike the member, rather than going to the login page.

For your information, I'm using mysql.

Please give me some advice ㅠ.

node.js mysql

2022-09-22 21:10

1 Answers

The request.isAuthenticated() method allows you to check if you are logged in.


2022-09-22 21:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.