From 7a4fd55a586d4f9daaa3d8fba92557cde04cbcd4 Mon Sep 17 00:00:00 2001 From: Simon Skoczylas Date: Thu, 12 Sep 2024 20:23:00 +0200 Subject: [PATCH] Improve used form action --- internal/server/handler/authorize/authorize.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/server/handler/authorize/authorize.go b/internal/server/handler/authorize/authorize.go index 248bca9..c1d3573 100644 --- a/internal/server/handler/authorize/authorize.go +++ b/internal/server/handler/authorize/authorize.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/google/uuid" "github.com/webishdev/stopnik/internal/config" + "github.com/webishdev/stopnik/internal/endpoint" internalHttp "github.com/webishdev/stopnik/internal/http" "github.com/webishdev/stopnik/internal/manager/cookie" "github.com/webishdev/stopnik/internal/manager/session" @@ -322,7 +323,8 @@ func (h *Handler) sendLogin(w http.ResponseWriter, r *http.Request, authSessionI query := r.URL.Query() encodedQuery := query.Encode() - formAction := fmt.Sprintf("authorize?%s", encodedQuery) + authorization := endpoint.Authorization[1:] + formAction := fmt.Sprintf("%s?%s", authorization, encodedQuery) loginToken := h.validator.NewLoginToken(authSessionId) loginTemplate := h.templateManager.LoginTemplate(loginToken, formAction, message)