From e2e77af4faf6ea69eeed8d2a5950efd6ae48ebd0 Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Sat, 6 Jul 2024 12:39:44 +0200 Subject: [PATCH] Email address not validated: send a dedicated error message. --- src/requests/login.cr | 2 +- src/responses/errors.cr | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/requests/login.cr b/src/requests/login.cr index f4e2ff5..22125d6 100644 --- a/src/requests/login.cr +++ b/src/requests/login.cr @@ -37,7 +37,7 @@ class AuthD::Request # In case the user hasn't validated his email address, # authentication shouldn't be possible. if user.contact.activation_key - return Response::ErrorInvalidCredentials.new + return Response::ErrorEmailAddressNotValidated.new end # MIGRATION diff --git a/src/responses/errors.cr b/src/responses/errors.cr index dd52e4d..81d34a2 100644 --- a/src/responses/errors.cr +++ b/src/responses/errors.cr @@ -102,4 +102,10 @@ class AuthD::Response end end AuthD.responses << ErrorPasswordTooLong + + IPC::JSON.message ErrorEmailAddressNotValidated, 36 do + def initialize() + end + end + AuthD.responses << ErrorEmailAddressNotValidated end