diff --git a/src/requests/register.cr b/src/requests/register.cr index cc83c11..ae1c250 100644 --- a/src/requests/register.cr +++ b/src/requests/register.cr @@ -36,6 +36,7 @@ class AuthD::Request # In this case we should not accept its registration. return Response::ErrorPasswordTooShort.new if @password.size < 20 + return Response::ErrorPasswordTooLong.new if @password.size > 100 uid = authd.new_uid password = authd.hash_password @password diff --git a/src/responses/errors.cr b/src/responses/errors.cr index 2cf12c6..dd52e4d 100644 --- a/src/responses/errors.cr +++ b/src/responses/errors.cr @@ -96,4 +96,10 @@ class AuthD::Response end end AuthD.responses << ErrorInvalidRenewKey + + IPC::JSON.message ErrorPasswordTooLong, 35 do + def initialize() + end + end + AuthD.responses << ErrorPasswordTooLong end