🗑️ Remove bus deps and code

This commit is contained in:
2024-01-27 01:11:32 +08:00
parent 69bae57473
commit d484b6b973
13 changed files with 273 additions and 369 deletions

22
pkg/server/factors_api.go Normal file
View File

@@ -0,0 +1,22 @@
package server
import (
"code.smartsheep.studio/hydrogen/passport/pkg/security"
"code.smartsheep.studio/hydrogen/passport/pkg/services"
"github.com/gofiber/fiber/v2"
)
func requestFactorToken(c *fiber.Ctx) error {
id, _ := c.ParamsInt("factorId", 0)
factor, err := services.LookupFactor(uint(id))
if err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error())
}
if err := security.GetFactorCode(factor); err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error())
}
return c.SendStatus(fiber.StatusOK)
}