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