♻️ OAuth authenticate

This commit is contained in:
2024-06-26 14:47:34 +08:00
parent 0d02eca76e
commit 21d3d71936
15 changed files with 328 additions and 240 deletions

View File

@ -29,7 +29,7 @@ func MapAPIs(app *fiber.App) {
me.Put("/", editUserinfo)
me.Get("/events", getEvents)
me.Get("/tickets", getTickets)
me.Delete("/tickets/:ticketId", killSession)
me.Delete("/tickets/:ticketId", killTicket)
me.Post("/confirm", doRegisterConfirm)
@ -51,12 +51,18 @@ func MapAPIs(app *fiber.App) {
api.Post("/users", doRegister)
api.Post("/auth", doAuthenticate)
api.Post("/auth/mfa", doMultiFactorAuthenticate)
api.Post("/auth/token", getToken)
auth := api.Group("/auth").Name("Auth")
{
auth.Post("/", doAuthenticate)
auth.Post("/mfa", doMultiFactorAuthenticate)
auth.Post("/token", getToken)
api.Get("/auth/factors", getAvailableFactors)
api.Post("/auth/factors/:factorId", requestFactorToken)
auth.Get("/factors", getAvailableFactors)
auth.Post("/factors/:factorId", requestFactorToken)
auth.Get("/o/authorize", tryAuthorizeThirdClient)
auth.Post("/o/authorize", authorizeThirdClient)
}
realms := api.Group("/realms").Name("Realms API")
{