From da5f974e68432db45427023664b40131f0d8f772 Mon Sep 17 00:00:00 2001
From: eternal-flame-AD <yume@yumechi.jp>
Date: Wed, 16 Nov 2022 17:49:00 -0600
Subject: [PATCH] trim space in yubikey otp response

---
 internal/auth/auth.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/internal/auth/auth.go b/internal/auth/auth.go
index 1ee5a17..59763f1 100644
--- a/internal/auth/auth.go
+++ b/internal/auth/auth.go
@@ -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")
 			}