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.5 to 0.0.6

20

index.js
const http = require('http');
const url = 'http://localhost:3000';
const url = "https://admin.microgen.id";

@@ -57,6 +57,2 @@ const generate = () => {

const middleware = ({ app, clientId }) => (req, res, next) => {
if(app.get("microgen") == "unauthorized") {
res.send({ message: "invalid hostname" })
return;
}

@@ -67,11 +63,16 @@ if(!clientId) {

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

@@ -82,3 +83,2 @@ return;

.catch(err => {
app.set("microgen", "unauthorized")
res.send({ message: "invalid hostname" })

@@ -85,0 +85,0 @@ return;

{
"name": "microgen-client",
"version": "0.0.5",
"version": "0.0.6",
"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