aboutsummaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2024-02-10 18:37:40 -0700
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2024-02-13 06:59:44 +0530
commite1c47572a6235fd8fd20af888ac3a11c7ae1369d (patch)
tree2dccff36a441916d7014037cef3f7ce84a790cad /providers
parentrefactor: project maintenance (diff)
downloadferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.gz
ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.zst
ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.zip
updates
Diffstat (limited to 'providers')
-rw-r--r--providers/AppProvider.ts2
-rw-r--r--providers/LegacyHashDriver.ts8
-rw-r--r--providers/LegacyHasherProvider.ts10
3 files changed, 10 insertions, 10 deletions
diff --git a/providers/AppProvider.ts b/providers/AppProvider.ts
index c84c0e6..4ee494c 100644
--- a/providers/AppProvider.ts
+++ b/providers/AppProvider.ts
@@ -1,4 +1,4 @@
1import { ApplicationService } from '@adonisjs/core/types' 1import { ApplicationService } from '@adonisjs/core/types';
2 2
3export default class AppProvider { 3export default class AppProvider {
4 constructor(protected app: ApplicationService) {} 4 constructor(protected app: ApplicationService) {}
diff --git a/providers/LegacyHashDriver.ts b/providers/LegacyHashDriver.ts
index eb2a263..d01e3bb 100644
--- a/providers/LegacyHashDriver.ts
+++ b/providers/LegacyHashDriver.ts
@@ -1,5 +1,5 @@
1import bcrypt from 'bcrypt' 1import bcrypt from 'bcrypt';
2import { HashDriverContract } from '@adonisjs/core/hash' 2import { HashDriverContract } from '@adonisjs/core/hash';
3 3
4/** 4/**
5 * Implementation of custom bcrypt driver 5 * Implementation of custom bcrypt driver
@@ -9,12 +9,12 @@ export class LegacyHashDriver implements HashDriverContract {
9 * Hash value 9 * Hash value
10 */ 10 */
11 public async make(value: string) { 11 public async make(value: string) {
12 return bcrypt.hash(value, 10) 12 return bcrypt.hash(value, 10);
13 } 13 }
14 /** 14 /**
15 * Verify value 15 * Verify value
16 */ 16 */
17 public async verify(hashedValue: string, plainValue: string) { 17 public async verify(hashedValue: string, plainValue: string) {
18 return bcrypt.compare(plainValue, hashedValue) 18 return bcrypt.compare(plainValue, hashedValue);
19 } 19 }
20} 20}
diff --git a/providers/LegacyHasherProvider.ts b/providers/LegacyHasherProvider.ts
index a4a25d9..b3ccd7f 100644
--- a/providers/LegacyHasherProvider.ts
+++ b/providers/LegacyHasherProvider.ts
@@ -1,14 +1,14 @@
1import { LegacyHashDriver } from './LegacyHashDriver.js' 1import { LegacyHashDriver } from './LegacyHashDriver.js';
2import { ApplicationService } from '@adonisjs/core/types' 2import { ApplicationService } from '@adonisjs/core/types';
3 3
4export default class LegacyHasherProvider { 4export default class LegacyHasherProvider {
5 constructor(protected app: ApplicationService) {} 5 constructor(protected app: ApplicationService) {}
6 6
7 public async boot() { 7 public async boot() {
8 const Hash = this.app.container.use('Adonis/Core/Hash') 8 const Hash = this.app.container.use('Adonis/Core/Hash');
9 9
10 Hash.extend('legacy', () => { 10 Hash.extend('legacy', () => {
11 return new LegacyHashDriver() 11 return new LegacyHashDriver();
12 }) 12 });
13 } 13 }
14} 14}