Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
127 views
in Technique[技术] by (71.8m points)

How to send authentication request to mongoDB when creating chrome Extension

I m creating chrome extension where the login page is there and i want to send the authentication request to mongoDB so that when user enter his credential details to login page the details should get authenticate with mongoDB that user is exist with that emailID and password. I reached upto post request , where i get the req.body data in console log and i am able to connect popup.js with background.js . But how to get connect with mongoDB to access the data present in the collections of mongoDB.

  
        var xj = new XMLHttpRequest();
        xj.open("POST", "http://websiteIm_using/login", true);
        xj.setRequestHeader("Content-Type", "application/json");
        xj.send(JSON.stringify({user_info}));
        xj.onreadystatechange = function () { if (xj.readyState == 4) { console.log(xj.responseText); 
```
question from:https://stackoverflow.com/questions/65651469/how-to-send-authentication-request-to-mongodb-when-creating-chrome-extension

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...