Skip to content

Commit

Permalink
user: show error if clearing auth cache fails
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jan 13, 2025
1 parent c36d9c9 commit e37bdd8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Thruk/Controller/user.pm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ sub user_page {

if($c->req->parameters->{'clear_auth_cache'}) {
$c->stash->{'profile_user'} = Thruk::Authentication::User->new($c, $c->stash->{'remote_user'})->set_dynamic_attributes($c);
Thruk::Utils::set_message( $c, 'success_message', 'Auth cache cleared successfully.' );
if($c->stash->{'profile_user'} && $c->stash->{'profile_user'}->{'timestamp'} && time() - $c->stash->{'profile_user'}->{'timestamp'} < 5) {
Thruk::Utils::set_message( $c, 'success_message', 'Auth cache cleared successfully.' );
} else {
Thruk::Utils::set_message( $c, 'fail_message', 'Failed to clear auth cache. Authoritive backends down?' );
}
return $c->redirect_to('user.cgi');
}

Expand Down

0 comments on commit e37bdd8

Please sign in to comment.