start password level
This commit is contained in:
parent
cbf0720493
commit
faebdfb215
28
public/js/zxcvbn.js
Normal file
28
public/js/zxcvbn.js
Normal file
File diff suppressed because one or more lines are too long
@ -20,14 +20,13 @@ router.get('/mail', render('mail'))
|
|||||||
|
|
||||||
// level V (vpn -> read mail)
|
// level V (vpn -> read mail)
|
||||||
router.get('/vpn', fromTor, fromVpn, checkCountry, (req, res, next) => {
|
router.get('/vpn', fromTor, fromVpn, checkCountry, (req, res, next) => {
|
||||||
console.log('son qui dentro');
|
|
||||||
if (!req.fromTor && req.fromVpn) {
|
if (!req.fromTor && req.fromVpn) {
|
||||||
res.render('vpnok', req.geoinfo);
|
res.render('vpnok', req.geoinfo);
|
||||||
} else {
|
} else {
|
||||||
res.render('vpnnook', req.geoinfo);
|
res.render('vpnnook', req.geoinfo);
|
||||||
}
|
}
|
||||||
// console.log('sono qui dentro?!?!');
|
|
||||||
// render('torok')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
router.get('/password', render('password'))
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
||||||
|
@ -39,9 +39,7 @@ const checkCountry = (req, res, next) => {
|
|||||||
const sourceIp = req.headers['x-forwarded-for'] || req.connection.remoteAddress
|
const sourceIp = req.headers['x-forwarded-for'] || req.connection.remoteAddress
|
||||||
request(`http://ip-api.com/json/${sourceIp}`, (err, res, body) => {
|
request(`http://ip-api.com/json/${sourceIp}`, (err, res, body) => {
|
||||||
if (!err && res.statusCode === 200) {
|
if (!err && res.statusCode === 200) {
|
||||||
console.log(body);
|
req.geoinfo = JSON.parse(body)
|
||||||
req.geoinfo = JSON.parse(body);
|
|
||||||
console.log(req.geoinfo);
|
|
||||||
}
|
}
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
|
16
views/password.pug
Normal file
16
views/password.pug
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
extends layout
|
||||||
|
|
||||||
|
block content
|
||||||
|
p.
|
||||||
|
Bla bla bla qui devi scegliere una password
|
||||||
|
|
||||||
|
input#password(type="password", name="password")
|
||||||
|
p#crackTime
|
||||||
|
|
||||||
|
script(src="/js/zxcvbn.js")
|
||||||
|
script.
|
||||||
|
var crackTime = document.getElementById('crackTime')
|
||||||
|
document.getElementById('password').oninput = function(ev, t) {
|
||||||
|
var ret = zxcvbn(this.value)
|
||||||
|
crackTime.innerHTML = ret.crack_times_display.offline_fast_hashing_1e10_per_second;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user