From 92bcba214c0f5789bfe28dee1d17de3bafdb3542 Mon Sep 17 00:00:00 2001 From: Manager Bot Date: Thu, 3 Nov 2022 06:05:17 +0000 Subject: [PATCH] Better user-exists message. --- Web/lib/MJB/Web/Controller/Auth.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Web/lib/MJB/Web/Controller/Auth.pm b/Web/lib/MJB/Web/Controller/Auth.pm index f7d13ac..cadeb3f 100644 --- a/Web/lib/MJB/Web/Controller/Auth.pm +++ b/Web/lib/MJB/Web/Controller/Auth.pm @@ -31,6 +31,9 @@ sub do_register ( $c ) { push @{$c->stash->{errors}}, "Password must be at least 8 characters" unless length($password) >= 8; + push @{$c->stash->{errors}}, "That email address is already registered." + if $c->db->people( { email => $email } )->count; + return if $c->stash->{errors}; my $person = try {