UNPKG

@adonisjs/ally

Version:

Social authentication provider for AdonisJS

34 lines (33 loc) 871 B
import { AllyManager } from "../chunk-NZT2DLWM.js"; import "../chunk-PZ5AY32C.js"; // providers/ally_provider.ts import { configProvider } from "@adonisjs/core"; import { HttpContext } from "@adonisjs/core/http"; import { RuntimeException } from "@poppinss/utils"; var AllyProvider = class { constructor(app) { this.app = app; } async boot() { const allyConfigProvider = this.app.config.get("ally"); const config = await configProvider.resolve(this.app, allyConfigProvider); if (!config) { throw new RuntimeException( 'Invalid "config/ally.ts" file. Make sure you are using the "defineConfig" method' ); } HttpContext.getter( "ally", function() { return new AllyManager(config, this); }, true ); } }; export { AllyProvider as default }; //# sourceMappingURL=ally_provider.js.map