Closed
Description
Hello currently I have this as a POST method on my backend:
app.post('/login', (req, res) => {
login();
function login() {
Parse.User.logIn("username", "test", {
success: function(user) {
// Do stuff after successful login, like a redirect.
console.log('User logged in successful with username: ' + user.get("username") + ' and email: ' + user.get("email"));
console.log(user.sessionToken)
},
error: function(user, error) {
console.log("The login failed with error: " + error.code + " " + error.message);
}
});
}
res.status(200).send("logging in");
});
Is this the right approach? Also if it is, how would I go about setting a current user? Do I just do that client side?
Would appreciate the direction, thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels