import { defineConfig } from '@adonisjs/auth';
import { AKJwtGuard } from '../modules/auth/jwt/jwt_guard.js';
import { AKJwtService } from '../modules/auth/jwt/jwt_service.js';
const authConfigResolved = defineConfig({
    default: 'jwt',
    guards: {
        jwt: {
            async resolver(_name, app) {
                const jwtService = await app.container.make(AKJwtService);
                const config = app.config.get('akago_auth');
                const userServiceClass = await config.userServiceClass.resolver(app);
                const userService = await app.container.make(userServiceClass);
                const emitter = await app.container.make('emitter');
                return (ctx) => new AKJwtGuard(ctx, jwtService, (id) => userService.findById(id), emitter);
            },
        },
    },
});
const authConfig = authConfigResolved;
export default authConfig;
//# sourceMappingURL=auth.js.map