trim space in yubikey otp response

This commit is contained in:
ゆめ 2022-11-16 17:49:00 -06:00
parent 933d67e9af
commit da5f974e68

View file

@ -7,6 +7,7 @@ import (
"fmt" "fmt"
"log" "log"
"net/http" "net/http"
"strings"
"time" "time"
"github.com/alexedwards/argon2id" "github.com/alexedwards/argon2id"
@ -184,6 +185,7 @@ func Register(g *echo.Group) (err error) {
} }
var verifiedOtpPubId string var verifiedOtpPubId string
if form.OtpResponse != "" { if form.OtpResponse != "" {
form.OtpResponse = strings.TrimSpace(form.OtpResponse)
if yubiAuth == nil { if yubiAuth == nil {
return echo.NewHTTPError(http.StatusNotImplemented, "Yubikey authentication not configured") return echo.NewHTTPError(http.StatusNotImplemented, "Yubikey authentication not configured")
} }