diff --git a/server/provide.go b/server/provide.go index 583a50d..023e568 100644 --- a/server/provide.go +++ b/server/provide.go @@ -15,6 +15,7 @@ import ( "github.com/xmdhs/authlib-skin/config" "github.com/xmdhs/authlib-skin/db/cache" "github.com/xmdhs/authlib-skin/db/ent" + "github.com/xmdhs/authlib-skin/db/ent/migrate" ) func ProvideSlog(c config.Config) slog.Handler { @@ -62,7 +63,7 @@ func ProvideEnt(ctx context.Context, db *sql.DB, c config.Config, sl *slog.Logge opts = append(opts, ent.Debug()) } e := ent.NewClient(opts...) - err := e.Schema.Create(ctx) + err := e.Schema.Create(ctx, migrate.WithForeignKeys(false), migrate.WithDropIndex(true), migrate.WithDropColumn(true)) if err != nil { return nil, nil, fmt.Errorf("ProvideEnt: %w", err) } diff --git a/server/route/route.go b/server/route/route.go index b9136bf..794a289 100644 --- a/server/route/route.go +++ b/server/route/route.go @@ -23,6 +23,7 @@ func NewRoute(yggService *yggdrasil.Yggdrasil, handel *handle.Handel) (*httprout func newYggdrasil(r *httprouter.Router, handelY yggdrasil.Yggdrasil) error { r.POST("/api/authserver/authenticate", warpHJSON(handelY.Authenticate())) + r.POST("/api/authserver/validate", warpHJSON(handelY.Validate())) return nil }