aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Auth.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-08-19 11:17:36 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-08-22 10:58:59 +0100
commitcf9e0477acd8614085654bf437162796b3a051e5 (patch)
tree5fd8f6ee4690549931bfa57d87322337fe53f7bb /perllib/FixMyStreet/App/Controller/Auth.pm
parent748ae2de2c766173b9438dbe3d834e8254626d87 (diff)
Always return a name string if login successful.
The app checks if name is set as a test for successful login.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Auth.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Auth.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm
index d4784ae8c..e23690368 100644
--- a/perllib/FixMyStreet/App/Controller/Auth.pm
+++ b/perllib/FixMyStreet/App/Controller/Auth.pm
@@ -466,7 +466,8 @@ sub ajax_sign_in : Path('ajax/sign_in') {
my $return = {};
if ( $c->forward( 'sign_in', [ $c->get_param('email') ] ) ) {
- $return->{name} = $c->user->name;
+ $return->{name} = $c->user->name || '-'; # App currently requires something returned
+ $return->{success} = 1;
} else {
$return->{error} = 1;
}