Add extra logging for oauth HandleAuthorizeRequest

This commit is contained in:
Melon 2024-07-28 20:54:21 +01:00
parent 8d489825d7
commit d9d1a5e452
Signed by: melon
GPG Key ID: 6C9D970C50D26A25
2 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package server
import (
"github.com/1f349/lavender/logger"
"github.com/1f349/lavender/pages"
"github.com/1f349/lavender/scope"
"github.com/julienschmidt/httprouter"
@ -110,6 +111,7 @@ func (h *HttpServer) authorizeEndpoint(rw http.ResponseWriter, req *http.Request
// redirect with an error if the action is not authorize
if form.Get("oauth_action") == "authorize" || isSSO {
if err := h.oauthSrv.HandleAuthorizeRequest(rw, req); err != nil {
logger.Logger.Error(err)
http.Error(rw, err.Error(), http.StatusBadRequest)
}
return

4
test-client/run2.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
cd "$(dirname -- "$(readlink -f -- "$0";)";)"
python3 -m http.server 2021