~netlandish/links-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH links] More edge case bug fixes

Details
Message ID
<20250905195724.7381-1-peter@netlandish.com>
Sender timestamp
1757080641
DKIM signature
missing
Download raw message
Patch: +4 -4
---
 admin/middleware.go | 2 +-
 core/routes.go      | 4 ++--
 helpers.go          | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/admin/middleware.go b/admin/middleware.go
index a6b19ee..3de32a3 100644
--- a/admin/middleware.go
+++ b/admin/middleware.go
@@ -12,7 +12,7 @@ func superUserRequierd() echo.MiddlewareFunc {
	return func(next echo.HandlerFunc) echo.HandlerFunc {
		return func(c echo.Context) error {
			gctx := c.(*server.Context)
			if gctx.User.IsSuperUser() {
			if gctx.User != nil && gctx.User.IsSuperUser() {
				return next(c)
			}
			return echo.NotFoundHandler(c)
diff --git a/core/routes.go b/core/routes.go
index 39a13f6..2c2cf09 100644
--- a/core/routes.go
+++ b/core/routes.go
@@ -148,7 +148,7 @@ func (s *Service) Homepage(c echo.Context) error {
	}

	gctx := c.(*server.Context)
	if gctx.User.IsAuthenticated() {
	if gctx.User != nil && gctx.User.IsAuthenticated() {
		// Redirect logged in users to their home feed
		return c.Redirect(http.StatusFound, c.Echo().Reverse(s.RouteName("home_link_list")))
	}
@@ -3702,7 +3702,7 @@ func (s *Service) NoteDetail(c echo.Context) error {
		"pd":        pd,
		"link":      link,
		"IsPrivate": link.IsPrivate(),
		"IsAuth":    gctx.User.IsAuthenticated(),
		"IsAuth":    gctx.User != nil && gctx.User.IsAuthenticated(),
		"navFlag":   "notes",
		"seoData":   seoData,
	}
diff --git a/helpers.go b/helpers.go
index 3a860bc..82f5143 100644
--- a/helpers.go
+++ b/helpers.go
@@ -1237,7 +1237,7 @@ func StripURLFragment(furl string) string {
func TagAbuseRedirect(c echo.Context) error {
	gctx := c.(*server.Context)
	tags := c.QueryParam("tag")
	if !gctx.User.IsAuthenticated() && tags != "" {
	if (gctx.User == nil || !gctx.User.IsAuthenticated()) && tags != "" {
		ntags := strings.Split(tags, ",")
		if len(ntags) > 2 {
			lt := localizer.GetSessionLocalizer(c)
-- 
2.49.1
Details
Message ID
<DCL5IAQL60MR.26VO68K9BE2RH@netlandish.com>
In-Reply-To
<20250905195724.7381-1-peter@netlandish.com> (view parent)
Sender timestamp
1757082749
DKIM signature
missing
Download raw message
Applied.

To git@git.code.netlandish.com:~netlandish/links
   271d9a6..b250826  master -> master
Reply to thread Export thread (mbox)