Skip to content

Commit

Permalink
Merge pull request #4452 from solgenomics/topic/fix_login_issue
Browse files Browse the repository at this point in the history
fix an issue with the /user/logged_in ajax call.
  • Loading branch information
lukasmueller authored Feb 15, 2023
2 parents ddf45b8 + 9e1c8da commit 23fd55b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 6 additions & 1 deletion lib/CXGN/Login.pm
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ sub get_login_status {

sub get_login_info {
my $self = shift;
return $self->{login_info};
if ($self->has_session()) {
return $self->{login_info};
}
else {
return {};
}
}

=head2 verify_session
Expand Down
7 changes: 1 addition & 6 deletions lib/SGN/Controller/AJAX/Login.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ sub is_logged_in :Path('/user/logged_in') Args(0) {
my $dbh = $c->dbic_schema("CXGN::People::Schema")->storage->dbh();;
my $login = CXGN::Login->new($dbh);
if (my ($person_id, $user_type) = $login->has_session()) {
my $user_id = CXGN::People::Person->new($dbh,$person_id);
my $login_info = $login->get_login_info();
$c->stash->{rest} = $login -> get_login_info;
# user_id => $user_id,
# username => $user->get_object->get_username(),
# first_name => $user->get_object->get_first_name(),
# last_name => $user->get_object->get_last_name(),
# };
return;
}
$c->stash->{rest} = { user_id => 0 };
Expand Down

0 comments on commit 23fd55b

Please sign in to comment.