Commit fc839cce authored by Benjamin Rokseth's avatar Benjamin Rokseth
Browse files

koha: small fix to Deichman::Auth

parent ed236435
...@@ -47,23 +47,21 @@ sub Auth { ...@@ -47,23 +47,21 @@ sub Auth {
my $session = $self->{session}; my $session = $self->{session};
my $req = $self->{req}; my $req = $self->{req};
C4::Context->_new_userenv( $session->id );
$session or Deichman::Exception::Auth::InvalidSession->throw(); $session or Deichman::Exception::Auth::InvalidSession->throw();
$req or Deichman::Exception::Auth::InvalidQuery->throw(); $req or Deichman::Exception::Auth::InvalidQuery->throw();
C4::Context->_new_userenv( $session->id );
if ($req->param("logout.x") ) { if ($req->param("logout.x") ) {
$self->LogOut(); $self->LogOut();
} }
# validate session # validate session
my $auth = $session->get("auth"); my $auth = $session->get("auth");
if ($auth) { if ($auth) {
warn "GOT AUTH SESSION"; warn "GOT AUTHENTICATED SESSION";
$session->put(auth => $auth);
#use Data::Dumper; warn Dumper($session);
return; return;
} else { } else {
warn "NO AUTH SESSION"; warn "NO AUTH SESSION - TRYING TO CREATE ONE";
# Run all auth methods # Run all auth methods
my $auth = $self->checkAuthMethods(); my $auth = $self->checkAuthMethods();
$auth or Deichman::Exception::Auth::InvalidSession->throw(); $auth or Deichman::Exception::Auth::InvalidSession->throw();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment