Skip to content

Commit

Permalink
OpenID: Clarify the impact of errors to users and admins
Browse files Browse the repository at this point in the history
  • Loading branch information
okurz committed Oct 4, 2024
1 parent 43cd403 commit f229129
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/OpenQA/WebAPI/Auth/OpenID.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,17 @@ sub auth_response ($c) {
);

my $err_handler = sub ($err, $txt) {
$c->app->log->error("OpenID: $err: $txt");
$c->flash(error => "$err: $txt");
$c->app->log->error("OpenID: $err: $txt. Consider a report to the authentication server administrators.");
$c->flash(error =>
"$err: $txt. Please retry again. If this reproduces please report the problem to the system administrators."
);
return (error => 0);
};

$csr->handle_server_response(
not_openid => sub () {
my $op_uri = $params{'openid.op_endpoint'} // '';
$err_handler->('Failed to login', "OpenID provider '$op_uri' returned invalid data. Please retry again");
$err_handler->('Failed to login', "OpenID provider '$op_uri' returned invalid data on a login attempt.");
},
setup_needed => sub ($setup_url) {
# Redirect the user to $setup_url
Expand Down

0 comments on commit f229129

Please sign in to comment.