"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const basic_auth_1 = __importDefault(require("@fastify/basic-auth"));
const fastify_plugin_1 = __importDefault(require("fastify-plugin"));
const basicAuthPlugin = async (fastify, opts) => {
    fastify.register(basic_auth_1.default, {
        validate(username, password, req, reply, done) {
            if (opts.passphrases.includes(password)) {
                done();
            }
            else {
                done(new Error("Wrong Passphrase"));
            }
        },
    });
};
exports.default = fastify_plugin_1.default(basicAuthPlugin);
//# sourceMappingURL=basic-auth.js.map