Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
deichman
Commits
c0ee0d47
Commit
c0ee0d47
authored
Jan 09, 2019
by
Benjamin Rokseth
Committed by
Benjamin Rokseth
Jan 10, 2019
Browse files
timber: fix login and logout koha session
remove api user and retry
parent
c6e8b93b
Changes
1
Hide whitespace changes
Inline
Side-by-side
koha/Koha/REST/V1/Session.pm
View file @
c0ee0d47
...
...
@@ -24,7 +24,7 @@ sub login {
my
$cgi
=
CGI
->
new
;
$cgi
->
param
(
userid
=>
$userid
);
$cgi
->
param
(
password
=>
$password
);
my
(
$status
,
$session
)
=
C4::Auth::
check_api_auth
(
$cgi
);
my
(
$status
,
$cookie
,
$session
id
)
=
C4::Auth::
check_api_auth
(
$cgi
);
$patron
=
Koha::
Patrons
->
find
({
userid
=>
$userid
})
unless
$patron
;
$patron
=
Koha::
Patrons
->
find
({
cardnumber
=>
$userid
})
unless
$patron
;
...
...
@@ -35,9 +35,9 @@ sub login {
return
$c
->
render
(
status
=>
403
,
json
=>
{
error
=>
"
Database is under maintenance.
"
})
if
$status
eq
"
maintenance
";
return
$c
->
render
(
status
=>
403
,
json
=>
{
error
=>
"
Login failed.
"
})
unless
$status
eq
"
ok
";
$c
->
cookie
('
koha.session
'
=>
$session
->
{
id
}
,
{
path
=>
"
/
"
});
$c
->
cookie
('
koha.session
'
=>
$sessionid
,
{
path
=>
"
/
"
});
return
$c
->
render
(
status
=>
201
,
json
=>
$
sessi
on
);
return
$c
->
render
(
status
=>
201
,
json
=>
$
patr
on
);
}
sub
logout
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment