From 7922e44c8973344cb614e250469d2c2a48aee78b Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Fri, 14 Oct 2022 16:44:42 -0600 Subject: [PATCH] Passing in user instance on cases where it makes sense for data processing by external apps --- accounts/routes.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/accounts/routes.go b/accounts/routes.go index 90fd16b..fa07146 100644 --- a/accounts/routes.go +++ b/accounts/routes.go @@ -518,6 +518,7 @@ func (s *Service) ForgotPasswordConfPOST(c echo.Context) error { return err } + c.Set("user", user) if err := s.fetch.ProcessSuccessfulPasswordReset(c); err != nil { return err } @@ -581,6 +582,7 @@ func (s *Service) ConfirmEmailConf(c echo.Context) error { return err } + c.Set("user", user) if err := s.fetch.ProcessSuccessfulEmailConfirmation(c); err != nil { return err } @@ -743,7 +745,7 @@ func (s *Service) UpdateEmailConf(c echo.Context) error { } // Everything good, load user for verification - _, err = s.fetch.FromDB(gctx.Server.DB, conf.UserID, false) + user, err := s.fetch.FromDB(gctx.Server.DB, conf.UserID, false) if err != nil { if err == sql.ErrNoRows { // Should never be reached @@ -772,6 +774,7 @@ func (s *Service) UpdateEmailConf(c echo.Context) error { return err } + c.Set("user", user) if err := s.fetch.ProcessSuccessfulEmailUpdate(c); err != nil { return err } -- 2.45.2