You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
I'm using mean js as a backend, front end I have ionic.
If have an API that should be callled only when the user is logged in, how do I make sure that the call is being made by that specific user that just logged in ?
Coz there's no any kind of token being sent from mean/ backend which makes sure who is calling the API. Your suggestions would be appreciated :-)
The text was updated successfully, but these errors were encountered:
Your App API should be making a login request and work with cookies, this way you can track who the user is and you basically get a req.user object populated with this information which you can handle in your routes or middlewares.
Property.find({req.body.username: id }).sort('-created').populate('user', 'displayName').exec(function(err, properties) {
// code,
So before it starts searching for the mongodb, it should make sure, who the user is and if the login usename, password is correct and only then it would let it search in the database,
Am i getting it right ?
Rather than doing the whole above process, Or i can also use jwt tokens to authenticate, who the user is.
I'm using mean js as a backend, front end I have ionic.
If have an API that should be callled only when the user is logged in, how do I make sure that the call is being made by that specific user that just logged in ?
Coz there's no any kind of token being sent from mean/ backend which makes sure who is calling the API. Your suggestions would be appreciated :-)
The text was updated successfully, but these errors were encountered: