forked from geolba/tethys.backend
Arno Kaimbacher
4714dfdd94
- npm normal updates - add all xslt and style asstes in extra folder public/assets2 - linting corrections - delete local .env.test from git tracking: git rm --cached .env.test - add .env.test into .gitignore file - add edit functionality for editing by submitter - npm updates -added xslt3 packeage for builfing sef files - added Language.ts class vor language table - added version to datasetxml2oai-pmh.xslt
22 lines
687 B
TypeScript
22 lines
687 B
TypeScript
import { HashDriverContract } from '@ioc:Adonis/Core/Hash';
|
|
// const bcrypt = require("bcrypt");
|
|
import bcrypt from 'bcryptjs';
|
|
|
|
const saltRounds = 10;
|
|
export class LaravelHash implements HashDriverContract {
|
|
public async make(value: string) {
|
|
const hashedValue = bcrypt.hashSync(value, saltRounds);
|
|
return hashedValue;
|
|
}
|
|
|
|
public async verify(hashedValue: string, plainValue: string) {
|
|
let newHash: string;
|
|
if (hashedValue.includes('$2y$10$')) {
|
|
newHash = hashedValue.replace('$2y$10$', '$2a$10$');
|
|
} else {
|
|
newHash = hashedValue;
|
|
}
|
|
return await bcrypt.compareSync(plainValue, newHash);
|
|
}
|
|
}
|