Skip to content

Commit 336333f

Browse files
committed
fix: add ability to validate password hash from adminforth.utils
1 parent 295b02f commit 336333f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

adminforth/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AdminForthAuth implements IAdminForthAuth {
4545
this.adminforth = adminforth;
4646
}
4747

48-
getClientIp(headers: object) {
48+
getClientIp(headers: object) {
4949
const clientIpHeader = this.adminforth.config.auth.clientIpHeader;
5050

5151
const headersLower = Object.keys(headers).reduce((acc, key) => {

adminforth/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ class AdminForth implements IAdminForth {
5959
return await AdminForthAuth.generatePasswordHash(password);
6060
},
6161

62+
verifyPassword: async (password, hash) => {
63+
return await AdminForthAuth.verifyPassword(password, hash);
64+
},
65+
6266
applyRegexValidation(value, validation) {
6367
if (validation?.length) {
6468
const validationArray = validation;

0 commit comments

Comments
 (0)