yazid138 2 days ago
parent
commit
b18bf93246
2 changed files with 1 additions and 11 deletions
  1. 1 1
      app.js
  2. 0 10
      controller/v1/pengunjung.controller.js

+ 1 - 1
app.js

@@ -11,7 +11,7 @@ require('./config/db')()
 
 app.use(logger('dev'))
 app.use(express.json())
-app.use(cors({ origin: true, credentials: true }))
+app.use(cors({ origin: '*', credentials: true }))
 app.use(express.urlencoded({ extended: false }))
 app.use(cookieParser(process.env.SRU51))
 // app.use(csrf( ['GET', 'HEAD', 'OPTIONS'], ['/v1/auth/login', /\/v1\/auto\//i, /v2/i]))

+ 0 - 10
controller/v1/pengunjung.controller.js

@@ -6,17 +6,7 @@ const { validate } = require('../../utils/v1/validation')
 exports.create = handleError(async (req, res) => {
   const { os, ipv4, location } = req.body
   const isValid = validate(res, req.body, {
-    os: 'string',
     ipv4: 'string',
-    location: {
-      $$type: 'object',
-      country: 'string',
-      region: 'string',
-      city: 'string',
-      lat: 'number',
-      lon: 'number',
-      timezone: 'string',
-    },
   })
   if (!isValid) return