mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
SECURITY: Limit name field length of TOTP authenticators and security keys
This commit is contained in:
@ -1551,6 +1551,11 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
def create_second_factor_security_key
|
||||
if current_user.all_security_keys.count >= UserSecurityKey::MAX_KEYS_PER_USER
|
||||
render_json_error(I18n.t("login.too_many_security_keys"), status: 422)
|
||||
return
|
||||
end
|
||||
|
||||
challenge_session = DiscourseWebauthn.stage_challenge(current_user, secure_session)
|
||||
render json:
|
||||
success_json.merge(
|
||||
|
Reference in New Issue
Block a user