epic-s6ts
[kivitendo-erp.git] / SL / Dispatcher / AuthHandler / Admin.pm
index babdc22..06fd3cf 100644 (file)
@@ -8,9 +8,9 @@ use SL::Layout::Dispatcher;
 sub handle {
   my ($self, %params) = @_;
 
-  %::myconfig = ();
+  %::myconfig = User->get_default_myconfig;
 
-  my $ok =  $::auth->get_api_token_cookie ? 1 : 0;
+  my $ok =  $::auth->is_api_token_cookie_valid;
   $ok  ||=  $::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::form->{'{AUTH}admin_password'})            == $::auth->OK());
   $ok  ||= !$::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::auth->get_session_value('admin_password')) == $::auth->OK());
   $ok  ||=  $params{action} eq 'login';