Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
chore: remove demo checks
Steven14479347d8d2
diff --git a/server/route/api/v1/user.go b/server/route/api/v1/user.goindex 1f56fc2b6..c70ffb0f2 100644--- a/server/route/api/v1/user.go+++ b/server/route/api/v1/user.go@@ -314,14 +314,6 @@ func (s *APIV1Service) DeleteUser(c echo.Context) error {return echo.NewHTTPError(http.StatusBadRequest, "Cannot delete current user")}- findUser, err := s.Store.GetUser(ctx, &store.FindUser{ID: &userID})- if err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user").SetInternal(err)- }- if s.Profile.Mode == "demo" && findUser.Username == "memos-demo" {- return echo.NewHTTPError(http.StatusForbidden, "Unauthorized to delete this user in demo mode")- }-if err := s.Store.DeleteUser(ctx, &store.DeleteUser{ID: userID,}); err != nil {@@ -372,10 +364,6 @@ func (s *APIV1Service) UpdateUser(c echo.Context) error {return echo.NewHTTPError(http.StatusBadRequest, "Invalid update user request").SetInternal(err)}- if s.Profile.Mode == "demo" && *request.Username == "memos-demo" {- return echo.NewHTTPError(http.StatusForbidden, "Unauthorized to update user in demo mode")- }-currentTs := time.Now().Unix()userUpdate := &store.UpdateUser{ID: userID,diff --git a/server/route/api/v2/user_service.go b/server/route/api/v2/user_service.goindex dad9acd7a..71e64004b 100644--- a/server/route/api/v2/user_service.go+++ b/server/route/api/v2/user_service.go@@ -130,10 +130,6 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUsreturn nil, status.Errorf(codes.NotFound, "user not found")}- if s.Profile.Mode == "demo" && user.Username == "memos-demo" {- return nil, status.Errorf(codes.PermissionDenied, "unauthorized to update user in demo mode")- }-currentTs := time.Now().Unix()update := &store.UpdateUser{ID: user.ID,@@ -203,10 +199,6 @@ func (s *APIV2Service) DeleteUser(ctx context.Context, request *apiv2pb.DeleteUsreturn nil, status.Errorf(codes.NotFound, "user not found")}- if s.Profile.Mode == "demo" && user.Username == "memos-demo" {- return nil, status.Errorf(codes.PermissionDenied, "unauthorized to delete this user in demo mode")- }-if err := s.Store.DeleteUser(ctx, &store.DeleteUser{ID: user.ID,}); err != nil {