mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
fix: check credential existence when signing via WebAuthn (#1336)
* fix: check credential existence when signing via WebAuthn * fix review problem
This commit is contained in:
@ -104,6 +104,11 @@ func (c *ApiController) WebAuthnSigninBegin() {
|
||||
c.ResponseError(fmt.Sprintf(c.T("UserErr.DoNotExistInOrg"), userOwner, userName))
|
||||
return
|
||||
}
|
||||
if len(user.WebauthnCredentials) == 0 {
|
||||
c.ResponseError(c.T("UserErr.NoWebAuthnCredential"))
|
||||
return
|
||||
}
|
||||
|
||||
options, sessionData, err := webauthnObj.BeginLogin(user)
|
||||
if err != nil {
|
||||
c.ResponseError(err.Error())
|
||||
|
Reference in New Issue
Block a user