mirror of
https://git.proxmox.com/git/pve-http-server
synced 2025-05-02 14:26:21 +00:00
pass auth_handler result to formatters
In case somebody want to display that info.
This commit is contained in:
parent
c715437597
commit
8001eb275f
@ -64,7 +64,7 @@ PVE = {
|
||||
_EOJS
|
||||
|
||||
sub new {
|
||||
my ($class, $res, $url) = @_;
|
||||
my ($class, $res, $url, $auth) = @_;
|
||||
|
||||
my $self = bless {
|
||||
url => $url,
|
||||
|
@ -174,7 +174,7 @@ PVE::APIServer::Formatter::register_formatter($portal_format, sub {
|
||||
$data = $res->{data};
|
||||
|
||||
my $html = '';
|
||||
my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path);
|
||||
my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path, $auth);
|
||||
|
||||
if (!HTTP::Status::is_success($res->{status})) {
|
||||
$html .= $doc->alert(text => "Error $res->{status}: $res->{message}");
|
||||
@ -250,7 +250,7 @@ PVE::APIServer::Formatter::register_page_formatter(
|
||||
code => sub {
|
||||
my ($res, $data, $param, $path, $auth) = @_;
|
||||
|
||||
my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path);
|
||||
my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path, $auth);
|
||||
|
||||
my $html = &$login_form($doc);
|
||||
|
||||
@ -277,7 +277,7 @@ PVE::APIServer::Formatter::register_page_formatter(
|
||||
# Note: HTTP server redirects to 'GET /access/ticket', so below
|
||||
# output is not really visible.
|
||||
|
||||
my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path);
|
||||
my $doc = PVE::APIServer::Formatter::Bootstrap->new($res, $path, $auth);
|
||||
|
||||
my $html = &$login_form($doc);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user