Lee Morgan 6 lat temu
rodzic
commit
17deb83909
1 zmienionych plików z 1 dodań i 3 usunięć
  1. 1 3
      controllers/otherData.js

+ 1 - 3
controllers/otherData.js

@@ -218,10 +218,8 @@ module.exports = {
 
 
     cloverAuth: function(req, res){
     cloverAuth: function(req, res){
         let authorizationCode = req.url.slice(req.url.indexOf("code=") + 5);
         let authorizationCode = req.url.slice(req.url.indexOf("code=") + 5);
-        req.session.merchantId = req.url.slice(req.url.indexOf("merchant_id=") + 12, req.url.indexOf("&client_id"))
+        req.session.merchantId = req.url.slice(req.url.indexOf("merchant_id=") + 12, req.url.indexOf("&"))
         
         
-        console.log("I have run");
-
         axios.get(`${process.env.CLOVER_ADDRESS}/oauth/token?client_id=${process.env.SUBLINE_CLOVER_APPID}&client_secret=${process.env.SUBLINE_CLOVER_APPSECRET}&code=${authorizationCode}`)
         axios.get(`${process.env.CLOVER_ADDRESS}/oauth/token?client_id=${process.env.SUBLINE_CLOVER_APPID}&client_secret=${process.env.SUBLINE_CLOVER_APPSECRET}&code=${authorizationCode}`)
             .then((response)=>{
             .then((response)=>{
                 req.session.accessToken = response.data.access_token;
                 req.session.accessToken = response.data.access_token;