mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 18:54:03 +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:
parent
6e6a0a074a
commit
8890d1d7c7
@ -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())
|
||||
|
@ -134,4 +134,5 @@ NameTooLang = Username is too long (maximum is 39 characters).
|
||||
NameFormatErr = The username may only contain alphanumeric characters, underlines or hyphens, cannot have consecutive hyphens or underlines, and cannot begin or end with a hyphen or underline.
|
||||
PasswordLessThanSixCharacters = Password must have at least 6 characters
|
||||
InvalidInformation = Invalid information
|
||||
NoWebAuthnCredential = Found no credentials for this user
|
||||
|
||||
|
@ -134,4 +134,5 @@ NameTooLang = Username is too long (maximum is 39 characters).
|
||||
NameFormatErr = The username may only contain alphanumeric characters, underlines or hyphens, cannot have consecutive hyphens or underlines, and cannot begin or end with a hyphen or underline.
|
||||
PasswordLessThanSixCharacters = Password must have at least 6 characters
|
||||
InvalidInformation = Invalid information
|
||||
NoWebAuthnCredential = Found no credentials for this user
|
||||
|
||||
|
@ -134,4 +134,5 @@ NameTooLang = Username is too long (maximum is 39 characters).
|
||||
NameFormatErr = The username may only contain alphanumeric characters, underlines or hyphens, cannot have consecutive hyphens or underlines, and cannot begin or end with a hyphen or underline.
|
||||
PasswordLessThanSixCharacters = Password must have at least 6 characters
|
||||
InvalidInformation = Invalid information
|
||||
NoWebAuthnCredential = Found no credentials for this user
|
||||
|
||||
|
@ -134,4 +134,5 @@ NameTooLang = Username is too long (maximum is 39 characters).
|
||||
NameFormatErr = The username may only contain alphanumeric characters, underlines or hyphens, cannot have consecutive hyphens or underlines, and cannot begin or end with a hyphen or underline.
|
||||
PasswordLessThanSixCharacters = Password must have at least 6 characters
|
||||
InvalidInformation = Invalid information
|
||||
NoWebAuthnCredential = Found no credentials for this user
|
||||
|
||||
|
@ -134,4 +134,5 @@ NameTooLang = Username is too long (maximum is 39 characters).
|
||||
NameFormatErr = The username may only contain alphanumeric characters, underlines or hyphens, cannot have consecutive hyphens or underlines, and cannot begin or end with a hyphen or underline.
|
||||
PasswordLessThanSixCharacters = Password must have at least 6 characters
|
||||
InvalidInformation = Invalid information
|
||||
NoWebAuthnCredential = Found no credentials for this user
|
||||
|
||||
|
@ -134,4 +134,5 @@ NameTooLang = Username is too long (maximum is 39 characters).
|
||||
NameFormatErr = The username may only contain alphanumeric characters, underlines or hyphens, cannot have consecutive hyphens or underlines, and cannot begin or end with a hyphen or underline.
|
||||
PasswordLessThanSixCharacters = Password must have at least 6 characters
|
||||
InvalidInformation = Invalid information
|
||||
NoWebAuthnCredential = Found no credentials for this user
|
||||
|
||||
|
@ -134,4 +134,5 @@ NameTooLang = Username is too long (maximum is 39 characters).
|
||||
NameFormatErr = The username may only contain alphanumeric characters, underlines or hyphens, cannot have consecutive hyphens or underlines, and cannot begin or end with a hyphen or underline.
|
||||
PasswordLessThanSixCharacters = Password must have at least 6 characters
|
||||
InvalidInformation = Invalid information
|
||||
NoWebAuthnCredential = Found no credentials for this user
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
[ApplicationErr]
|
||||
AppNotFound = 应用 %%s 未找到
|
||||
AppNotFound = 应用 %s 未找到
|
||||
AppNotFoundForUserID = 找不到该用户的应用程序 %s
|
||||
GrantTypeNotSupport = 此应用中不支持此授权类型
|
||||
HasNoProviders = 该应用无提供商
|
||||
@ -25,7 +25,7 @@ EmptyErr = 邮箱不可为空
|
||||
EmailInvalid = 无效邮箱
|
||||
EmailCheckResult = Email: %s
|
||||
EmptyParam = 邮件参数为空: %v
|
||||
InvalidReceivers = 无效的邮箱接收者: %%s
|
||||
InvalidReceivers = 无效的邮箱接收者: %s
|
||||
UnableGetModifyRule = 无法得到Email修改规则
|
||||
|
||||
[EnforcerErr]
|
||||
@ -131,6 +131,7 @@ NameFormatErr = 用户名只能包含字母数字字符、下划线或连字符
|
||||
PasswordLessThanSixCharacters = 密码至少为6字符
|
||||
DoNotExistSignUp = 用户不存在,请先注册
|
||||
InvalidInformation = 无效信息
|
||||
NoWebAuthnCredential = 该用户没有WebAuthn凭据
|
||||
|
||||
[StorageErr]
|
||||
ObjectKeyNotAllowed = object key :%s 不被允许
|
||||
|
Loading…
x
Reference in New Issue
Block a user