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 ba06387 commit b051faf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/OpenQA/WebAPI/Auth/OpenID.pm
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,19 @@ sub auth_response ($c) {

my $err_handler = sub ($err, $txt) {
$c->app->log->error("OpenID: $err: $txt");
$c->flash(error => "$err: $txt");
$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. Report to the authentication server administrators."
);
},
setup_needed => sub ($setup_url) {
# Redirect the user to $setup_url
Expand Down

0 comments on commit b051faf

Please sign in to comment.