@@ -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]))
@@ -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