tethys.backend/providers/AppProvider.ts
2023-03-03 16:54:28 +01:00

28 lines
709 B
TypeScript

import type { ApplicationContract } from '@ioc:Adonis/Core/Application';
import Hash from '@ioc:Adonis/Core/Hash';
import { LaravelHash } from './HashDriver';
export default class AppProvider {
constructor(protected app: ApplicationContract) {}
public register() {
// Register your own bindings
}
public async boot() {
// IoC container is ready
const hashInstance: typeof Hash = this.app.container.use('Adonis/Core/Hash');
hashInstance.extend('bcrypt', () => {
return new LaravelHash();
});
}
public async ready() {
// App is ready
}
public async shutdown() {
// Cleanup, since app is going down
}
}