Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router.post('/getlogin', function (req, res) {
- username = req.body.username;
- password = req.body.password;
- adminlogin = database.ref('booths');
- adminlogin.once('value', function(snapshot){
- var dataSet = [];
- snapshot.forEach(function(childsnapshot){
- user = childsnapshot.val().username;
- pass = childsnapshot.val().password;
- if(username == user){
- req.session.user = childsnapshot.key;
- req.session.auth = true;
- return res.status(200).send('Success');
- }else{
- return res.status(401).send('false');
- }
- });
- })
- })
Add Comment
Please, Sign In to add comment