Skip to content

Commit

Permalink
redirect old settings urls to new ones
Browse files Browse the repository at this point in the history
  • Loading branch information
daviian committed May 11, 2018
1 parent 1f90d56 commit e4601ce
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions routers/routes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,24 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/keys/delete", user.DeleteKey)
m.Get("/organization", user.SettingsOrganization)
m.Get("/repos", user.SettingsRepos)

// redirects from old settings urls to new ones
// TODO: can be removed on next major version
m.Get("/avatar", func(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/user/settings")
})
m.Get("/email", func(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
})
m.Get("/delete", func(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
})
m.Get("/openid", func(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/user/settings/security")
})
m.Get("/account_link", func(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/user/settings/security")
})
}, reqSignIn, func(ctx *context.Context) {
ctx.Data["PageIsUserSettings"] = true
})
Expand Down

0 comments on commit e4601ce

Please sign in to comment.