Add verificationCode to login method

This commit is contained in:
Gucheng Wang
2022-10-03 15:10:48 +08:00
parent 9c48582e0c
commit 67f3c5a489
10 changed files with 61 additions and 73 deletions

View File

@ -16,6 +16,7 @@ package controllers
import (
"bytes"
"fmt"
"io"
"github.com/casdoor/casdoor/object"
@ -100,7 +101,7 @@ func (c *ApiController) WebAuthnSigninBegin() {
userName := c.Input().Get("name")
user := object.GetUserByFields(userOwner, userName)
if user == nil {
c.ResponseError("Please Giveout Owner and Username.")
c.ResponseError(fmt.Sprintf("The user: %s/%s doesn't exist", userOwner, userName))
return
}
options, sessionData, err := webauthnObj.BeginLogin(user)