Initial upload to Gitea
This commit is contained in:
1 parent
78193254ad
commit
8478998cae
1485 files changed
+461025
-42348
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
const crypto = require("node:crypto");
|
||||
|
||||
function getRememberLoginFingerprint(user) {
|
||||
if (!user || !user.password) return "";
|
||||
// adpanel:remember-account-generation - a missed revocation cannot restore
|
||||
// a saved login after suspension ends or after credentials are reverted.
|
||||
return crypto
|
||||
.createHash("sha256")
|
||||
.update(String(user.password || ""))
|
||||
.update("\n")
|
||||
.update(String(user.secret || ""))
|
||||
.update("\naccount-epoch:")
|
||||
.update(user.session_epoch == null ? "legacy" : String(user.session_epoch))
|
||||
.digest("hex");
|
||||
}
|
||||
|
||||
module.exports = { getRememberLoginFingerprint };
|
||||
Reference in new issue
Block a user