mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-03 12:47:50 +02:00
23 lines
708 B
JavaScript
23 lines
708 B
JavaScript
function promptLooksFingerprint(text) {
|
|
var s = String(text || "").toLowerCase()
|
|
return s.indexOf("finger") !== -1 || s.indexOf("fprint") !== -1 || s.indexOf("swipe") !== -1
|
|
}
|
|
|
|
function fingerprintFirstFromPamConfig(raw) {
|
|
var lines = String(raw || "").split("\n")
|
|
for (var i = 0; i < lines.length; i++) {
|
|
var line = lines[i].replace(/^\s+|\s+$/g, "")
|
|
if (!line || line.charAt(0) === "#") continue
|
|
if (!line.match(/^auth\s+/)) continue
|
|
return line.indexOf("pam_fprintd.so") !== -1
|
|
}
|
|
return false
|
|
}
|
|
|
|
if (typeof module !== "undefined") {
|
|
module.exports = {
|
|
promptLooksFingerprint: promptLooksFingerprint,
|
|
fingerprintFirstFromPamConfig: fingerprintFirstFromPamConfig
|
|
}
|
|
}
|