@@ 62,7 62,7 @@ func (s *Service) Logout(c echo.Context) error {
func (s *Service) Login(c echo.Context) error {
user := s.fetch.FromContext(c)
if user.IsAuthenticated() {
- return c.Redirect(http.StatusMovedPermanently, s.fetch.RedirectAfterLogin(c))
+ return c.Redirect(http.StatusMovedPermanently, s.fetch.RedirectAfterLogin(c, ""))
}
lt := s.fetch.LoginType()
@@ 135,9 135,7 @@ func (s *Service) LoginAuthPOST(c echo.Context) error {
return err
}
- if form.Next == "" {
- form.Next = s.fetch.RedirectAfterLogin(c)
- }
+ form.Next = s.fetch.RedirectAfterLogin(c, form.Next)
return c.Redirect(http.StatusMovedPermanently, form.Next)
}
@@ 250,7 248,7 @@ func (s *Service) LoginEmailConf(c echo.Context) error {
if err := s.fetch.ProcessSuccessfulLogin(c, user); err != nil {
return err
}
- return c.Redirect(http.StatusMovedPermanently, s.fetch.RedirectAfterLogin(c))
+ return c.Redirect(http.StatusMovedPermanently, s.fetch.RedirectAfterLogin(c, ""))
}
// ChangePassword changes the password for an authenticated user
@@ 305,7 303,7 @@ func (s *Service) ForgotPassword(c echo.Context) error {
user := s.fetch.FromContext(c)
if user.IsAuthenticated() {
- return c.Redirect(http.StatusMovedPermanently, s.fetch.RedirectAfterLogin(c))
+ return c.Redirect(http.StatusMovedPermanently, s.fetch.RedirectAfterLogin(c, ""))
}
sent := c.QueryParam("sent")
@@ 60,7 60,7 @@ type UserFetch interface {
ProcessSuccessfulEmailUpdate(c echo.Context) error
ProcessSuccessfulEmailConfirmation(c echo.Context) error
- RedirectAfterLogin(c echo.Context) string
+ RedirectAfterLogin(c echo.Context, next string) string
RedirectAfterPasswordChange(c echo.Context) string
RedirectAfterPasswordReset(c echo.Context) string
RedirectAfterEmailUpdate(c echo.Context) string