mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-03 23:36:21 +02:00
28 lines
851 B
JavaScript
28 lines
851 B
JavaScript
"use strict";
|
|
/*
|
|
* @adonisjs/encryption
|
|
*
|
|
* (c) Harminder Virk <virk@adonisjs.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
/**
|
|
* Encryption provider to binding encryption class to the container
|
|
*/
|
|
class EncryptionProvider {
|
|
constructor(app) {
|
|
this.app = app;
|
|
}
|
|
register() {
|
|
this.app.container.singleton('Adonis/Core/Encryption', () => {
|
|
const Config = this.app.container.resolveBinding('Adonis/Core/Config');
|
|
const { Encryption } = require('../src/Encryption');
|
|
return new Encryption({ secret: Config.get('app.appKey') });
|
|
});
|
|
}
|
|
}
|
|
exports.default = EncryptionProvider;
|
|
EncryptionProvider.needsApplication = true;
|