mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:40:01 +00:00
add redirects for old setting panel urls
This commit is contained in:
parent
bb42d2609a
commit
239b957054
1 changed files with 16 additions and 2 deletions
|
@ -38,6 +38,8 @@
|
||||||
customCSSPath = profilePath + "/custom.css"
|
customCSSPath = profilePath + "/custom.css"
|
||||||
statusPath = profilePath + "/statuses/:" + statusIDKey
|
statusPath = profilePath + "/statuses/:" + statusIDKey
|
||||||
assetsPathPrefix = "/assets"
|
assetsPathPrefix = "/assets"
|
||||||
|
userPanelPath = "/settings/user"
|
||||||
|
adminPanelPath = "/settings/admin"
|
||||||
|
|
||||||
tokenParam = "token"
|
tokenParam = "token"
|
||||||
usernameKey = "username"
|
usernameKey = "username"
|
||||||
|
@ -71,9 +73,21 @@ func (m *Module) Route(s router.Router) error {
|
||||||
s.AttachHandler(http.MethodGet, "/settings", m.SettingsPanelHandler)
|
s.AttachHandler(http.MethodGet, "/settings", m.SettingsPanelHandler)
|
||||||
s.AttachHandler(http.MethodGet, "/settings/*panel", m.SettingsPanelHandler)
|
s.AttachHandler(http.MethodGet, "/settings/*panel", m.SettingsPanelHandler)
|
||||||
|
|
||||||
// redirect /auth/edit to /settings/user
|
// User panel redirects
|
||||||
|
// used by clients
|
||||||
s.AttachHandler(http.MethodGet, "/auth/edit", func(c *gin.Context) {
|
s.AttachHandler(http.MethodGet, "/auth/edit", func(c *gin.Context) {
|
||||||
c.Redirect(http.StatusMovedPermanently, "/settings/user")
|
c.Redirect(http.StatusMovedPermanently, userPanelPath)
|
||||||
|
})
|
||||||
|
|
||||||
|
// old version of settings panel
|
||||||
|
s.AttachHandler(http.MethodGet, "/user", func(c *gin.Context) {
|
||||||
|
c.Redirect(http.StatusMovedPermanently, userPanelPath)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Admin panel redirects
|
||||||
|
// old version of settings panel
|
||||||
|
s.AttachHandler(http.MethodGet, "/admin", func(c *gin.Context) {
|
||||||
|
c.Redirect(http.StatusMovedPermanently, adminPanelPath)
|
||||||
})
|
})
|
||||||
|
|
||||||
// serve front-page
|
// serve front-page
|
||||||
|
|
Loading…
Reference in a new issue