|
@@ -1,7 +1,7 @@
|
|
|
const express = require('express')
|
|
|
const router = express.Router()
|
|
|
|
|
|
-const { fromTor, fromVpn } = require('./utils')
|
|
|
+const { fromTor, fromVpn, checkCountry } = require('./utils')
|
|
|
|
|
|
// magic
|
|
|
const render = template => (req, res) => res.render(template)
|
|
@@ -19,9 +19,9 @@ router.get('/metadata', render('metadata'))
|
|
|
router.get('/mail', render('mail'))
|
|
|
|
|
|
// level V (vpn -> read mail)
|
|
|
-router.get('/vpn', fromTor, fromVpn, (req, res) => {
|
|
|
- if (!req.isTor && req.isVpn) render('vpnok')
|
|
|
- else render('vpnnook')
|
|
|
+router.get('/vpn', fromTor, fromVpn, checkCountry, (req, res) => {
|
|
|
+ if (!req.fromTor && req.fromVpn) render('vpnok', req.geoinfo )
|
|
|
+ else render('vpnnook', req.geoinfo )
|
|
|
})
|
|
|
|
|
|
module.exports = router
|