import fastifyBasicAuth from "@fastify/basic-auth";
import fp from "fastify-plugin";
const basicAuthPlugin = async (fastify, opts) => {
    fastify.register(fastifyBasicAuth, {
        validate(username, password, req, reply, done) {
            if (opts.passphrases.includes(password)) {
                done();
            }
            else {
                done(new Error("Wrong Passphrase"));
            }
        },
    });
};
export default fp(basicAuthPlugin);
//# sourceMappingURL=basic-auth.js.map