feat!(backend): move /auth/export to /users/@me/export

This commit is contained in:
Sam 2023-03-16 12:49:27 +01:00
parent 17f6ac4d23
commit f087e9a29f
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
5 changed files with 14 additions and 9 deletions

View file

@ -18,7 +18,6 @@ type Server struct {
RequireInvite bool
BaseURL string
ExporterPath string
}
type userResponse struct {
@ -57,7 +56,6 @@ func Mount(srv *server.Server, r chi.Router) {
Server: srv,
RequireInvite: os.Getenv("REQUIRE_INVITE") == "true",
BaseURL: os.Getenv("BASE_URL"),
ExporterPath: "http://127.0.0.1:" + os.Getenv("EXPORTER_PORT"),
}
r.Route("/auth", func(r chi.Router) {
@ -92,9 +90,6 @@ func Mount(srv *server.Server, r chi.Router) {
r.With(server.MustAuth).Post("/tokens", server.WrapHandler(s.createToken))
r.With(server.MustAuth).Delete("/tokens/{id}", server.WrapHandler(s.deleteToken))
r.With(server.MustAuth).Get("/export/start", server.WrapHandler(s.startExport))
r.With(server.MustAuth).Get("/export", server.WrapHandler(s.getExport))
// cancel user delete
// uses a special token, so handled in the function itself
r.Get("/cancel-delete", server.WrapHandler(s.cancelDelete))