Skip to content

Commit

Permalink
fixed post request
Browse files Browse the repository at this point in the history
  • Loading branch information
sojs-coder committed Jan 24, 2023
1 parent ced536c commit a03794c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
const fetch = require("node-fetch");

async function postData(data = {}) {
const url = "https://soauth.sojs.repl.co/checkValid";
async function postData(url = '', data = {}) {

const response = await fetch(url, {
method: 'POST',
mode: "cors",
headers: {
'Content-Type': 'application/json'
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*"
},
referrerPolicy: 'no-referrer',
body: JSON.stringify(data)
});
return response.json();

return response.json()
}
function soauth(req,res,next){
if(!req.so_auth){
Expand Down

0 comments on commit a03794c

Please sign in to comment.