summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
Diffstat (limited to 'providers')
-rw-r--r--providers/AppProvider.ts21
-rw-r--r--providers/LegacyHashDriver.ts20
-rw-r--r--providers/LegacyHasherProvider.ts14
3 files changed, 0 insertions, 55 deletions
diff --git a/providers/AppProvider.ts b/providers/AppProvider.ts
deleted file mode 100644
index 4ee494c..0000000
--- a/providers/AppProvider.ts
+++ /dev/null
@@ -1,21 +0,0 @@
1import { ApplicationService } from '@adonisjs/core/types';
2
3export default class AppProvider {
4 constructor(protected app: ApplicationService) {}
5
6 public register() {
7 // Register your own bindings
8 }
9
10 public async boot() {
11 // IoC container is ready
12 }
13
14 public async ready() {
15 // App is ready
16 }
17
18 public async shutdown() {
19 // Cleanup, since app is going down
20 }
21}
diff --git a/providers/LegacyHashDriver.ts b/providers/LegacyHashDriver.ts
deleted file mode 100644
index d01e3bb..0000000
--- a/providers/LegacyHashDriver.ts
+++ /dev/null
@@ -1,20 +0,0 @@
1import bcrypt from 'bcrypt';
2import { HashDriverContract } from '@adonisjs/core/hash';
3
4/**
5 * Implementation of custom bcrypt driver
6 */
7export class LegacyHashDriver implements HashDriverContract {
8 /**
9 * Hash value
10 */
11 public async make(value: string) {
12 return bcrypt.hash(value, 10);
13 }
14 /**
15 * Verify value
16 */
17 public async verify(hashedValue: string, plainValue: string) {
18 return bcrypt.compare(plainValue, hashedValue);
19 }
20}
diff --git a/providers/LegacyHasherProvider.ts b/providers/LegacyHasherProvider.ts
deleted file mode 100644
index b3ccd7f..0000000
--- a/providers/LegacyHasherProvider.ts
+++ /dev/null
@@ -1,14 +0,0 @@
1import { LegacyHashDriver } from './LegacyHashDriver.js';
2import { ApplicationService } from '@adonisjs/core/types';
3
4export default class LegacyHasherProvider {
5 constructor(protected app: ApplicationService) {}
6
7 public async boot() {
8 const Hash = this.app.container.use('Adonis/Core/Hash');
9
10 Hash.extend('legacy', () => {
11 return new LegacyHashDriver();
12 });
13 }
14}