You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
477 B
25 lines
477 B
package auth
|
|
|
|
import (
|
|
"github.com/go-chi/chi/v5"
|
|
"github.com/mnrva-dev/owltier.com/server/middleware"
|
|
)
|
|
|
|
func BuildRouter() *chi.Mux {
|
|
r := chi.NewRouter()
|
|
|
|
r.Post("/login", Login)
|
|
r.Post("/register", Register)
|
|
r.Group(func(r chi.Router) {
|
|
r.Use(middleware.TokenValidater)
|
|
r.Post("/delete", DeleteAccount)
|
|
})
|
|
r.Group(func(r chi.Router) {
|
|
r.Use(middleware.RefreshValidator)
|
|
r.Post("/token/refresh", Refresh)
|
|
})
|
|
r.Get("/token/validate", Validate)
|
|
|
|
return r
|
|
}
|