From 3957d4d774d59deb7927e4668dc91d86482de896 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 15 Jul 2024 06:22:50 +0200 Subject: [PATCH] Return 501 Not Implemented for nostr auth --- server/router/handler/auth.go | 8 ++++++++ server/router/pages/auth.templ | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/server/router/handler/auth.go b/server/router/handler/auth.go index 20c5c28..79399d4 100644 --- a/server/router/handler/auth.go +++ b/server/router/handler/auth.go @@ -20,6 +20,10 @@ func HandleAuth(sc context.Context, action string) echo.HandlerFunc { return LnAuth(sc, c, action) } + if c.Param("method") == "nostr" { + return NostrAuth(sc, c, action) + } + // on session guard redirects to /login, // we need to make sure that HTMX selects and targets correct element c.Response().Header().Add("HX-Retarget", "#content") @@ -153,6 +157,10 @@ func HandleLnAuthCallback(sc context.Context) echo.HandlerFunc { } } +func NostrAuth(sc context.Context, c echo.Context, action string) error { + return echo.NewHTTPError(http.StatusNotImplemented, nil) +} + func HandleSessionCheck(sc context.Context) echo.HandlerFunc { return func(c echo.Context) error { var ( diff --git a/server/router/pages/auth.templ b/server/router/pages/auth.templ index f9ac357..1209f3b 100644 --- a/server/router/pages/auth.templ +++ b/server/router/pages/auth.templ @@ -34,7 +34,10 @@ templ Auth(action string) { { action } with lightning -