Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

microgen-client

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

microgen-client - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

21

index.js

@@ -44,3 +44,3 @@ const http = require('http');

if(response.status == 'success') {
resolve(data);
resolve(response);
} else {

@@ -58,10 +58,21 @@ reject("failed");

const middleware = ({ app, clientId }) => (req, res, next) => {
if(!app.get("microgen") && clientId) {
if(app.get("microgen") == "unauthorized") {
res.send({ message: "invalid hostname" })
}
if((app.get("microgen") !== "authorized") && clientId) {
client(clientId)
.then(res => {
console.log(res)
console.log(req.hostname)
if(req.hostname.includes(res.hostname)) {
app.set("microgen", "authorized")
return;
} else {
app.set("microgen", "unauthorized")
res.send({ message: "invalid hostname" })
return;
}
})
.catch(err => {
console.log(err);
app.set("microgen", "unauthorized")
res.send({ message: "invalid hostname" })
return;
})

@@ -68,0 +79,0 @@ } else {

{
"name": "microgen-client",
"version": "0.0.3",
"version": "0.0.4",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc