@@ -734,29 +734,25 @@ func (h *SettingsHandler) actionClearData(w http.ResponseWriter, r *http.Request
734734}
735735
736736func (h * SettingsHandler ) actionDeleteUser (w http.ResponseWriter , r * http.Request ) actionResult {
737- // return error cannot delete user contact high seas support for help
738- routeutils .SetError (r , w , "Cannot delete user. Please contact support for help." )
739- return actionResult {- 1 , "" , "" , nil }
740-
741- // if h.config.IsDev() {
742- // loadTemplates()
743- // }
737+ if h .config .IsDev () {
738+ loadTemplates ()
739+ }
744740
745- // user := middlewares.GetPrincipal(r)
746- // go func(user *models.User) {
747- // slog.Info("deleting user shortly", "userID", user.ID)
748- // time.Sleep(5 * time.Minute)
749- // if err := h.userSrvc.Delete(user); err != nil {
750- // conf.Log().Request(r).Error("failed to delete user", "userID", user.ID, "error", err)
751- // } else {
752- // slog.Info("successfully deleted user", "userID", user.ID)
753- // }
754- // }(user)
741+ user := middlewares .GetPrincipal (r )
742+ go func (user * models.User ) {
743+ slog .Info ("deleting user shortly" , "userID" , user .ID )
744+ time .Sleep (5 * time .Minute )
745+ if err := h .userSrvc .Delete (user ); err != nil {
746+ conf .Log ().Request (r ).Error ("failed to delete user" , "userID" , user .ID , "error" , err )
747+ } else {
748+ slog .Info ("successfully deleted user" , "userID" , user .ID )
749+ }
750+ }(user )
755751
756- // routeutils.SetSuccess(r, w, "Your account will be deleted in a few minutes. Sorry to see you go.")
757- // http.SetCookie(w, h.config.GetClearCookie(models.AuthCookieKey))
758- // http.Redirect(w, r, h.config.Server.BasePath, http.StatusFound)
759- // return actionResult{-1, "", "", nil}
752+ routeutils .SetSuccess (r , w , "Your account will be deleted in a few minutes. Sorry to see you go." )
753+ http .SetCookie (w , h .config .GetClearCookie (models .AuthCookieKey ))
754+ http .Redirect (w , r , h .config .Server .BasePath , http .StatusFound )
755+ return actionResult {- 1 , "" , "" , nil }
760756}
761757
762758func (h * SettingsHandler ) actionGenerateInvite (w http.ResponseWriter , r * http.Request ) actionResult {
0 commit comments