MT#64282 replace redirect with ajax_logout separation

* a better way is to leave /logout as is and instead
  separate ajax_logout so that it's not chained from /logout
  anymore, resulting in 200 OK with empty application/json response,
  and without redirects by default

Change-Id: Ide4f3845532e176e6866ebe61155e04d02aa3fbd
(cherry picked from commit c48355ca03)
(cherry picked from commit c830a194d0)
mr12.5.1
Kirill Solomko 3 months ago
parent 813e8b70fb
commit af431eab27

@ -24,11 +24,14 @@ Catalyst Controller.
=cut
sub logout_index :Path {
my ($self, $c) = @_;
}
sub logout :Chained('/') :PathPart('logout') :Args(0) {
my ( $self, $c, $realm ) = @_;
$c->logout;
my $redirect = $c->req->params->{redirect} // 1;
$c->response->redirect($c->uri_for('/login')) if $redirect;
$c->response->redirect($c->uri_for('/login'));
}
sub ajax_logout :Chained('/') :PathPart('ajax_logout') :Args(0) {

Loading…
Cancel
Save