package middlewares

import (
	"quyun/v2/providers/jwt"

	"go.ipao.vip/atom/container"
	"go.ipao.vip/atom/opt"
)

func Provide(opts ...opt.Option) error {
	if err := container.Container.Provide(func(
		jwt *jwt.JWT,
	) (*Middlewares, error) {
		obj := &Middlewares{
			jwt: jwt,
		}
		if err := obj.Prepare(); err != nil {
			return nil, err
		}

		return obj, nil
	}); err != nil {
		return err
	}
	return nil
}
