Fix Login and Logout that were broken with SSL
This commit is contained in:
@@ -1,4 +1,10 @@
|
|||||||
2.024004 - 2014-03-04
|
2.024005 - 2014-03-04
|
||||||
|
|
||||||
|
[BUG FIXES]
|
||||||
|
|
||||||
|
* Fix Login and Logout that were broken with SSL
|
||||||
|
|
||||||
|
2.024003_001 - 2014-03-03
|
||||||
|
|
||||||
[ENHANCEMENTS]
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use Dancer::Plugin::Auth::Extensible;
|
|||||||
|
|
||||||
hook 'before' => sub {
|
hook 'before' => sub {
|
||||||
params->{return_url} ||= ((request->path ne uri_for('/')->path)
|
params->{return_url} ||= ((request->path ne uri_for('/')->path)
|
||||||
? request->path : uri_for('/inventory'));
|
? request->uri : uri_for('/inventory')->path);
|
||||||
|
|
||||||
if (! session('logged_in_user') && request->path ne uri_for('/login')->path) {
|
if (! session('logged_in_user') && request->path ne uri_for('/login')->path) {
|
||||||
if (setting('trust_x_remote_user') and scalar request->header('X-REMOTE_USER')) {
|
if (setting('trust_x_remote_user') and scalar request->header('X-REMOTE_USER')) {
|
||||||
@@ -85,7 +85,7 @@ any ['get', 'post'] => '/logout' => sub {
|
|||||||
});
|
});
|
||||||
|
|
||||||
session->destroy;
|
session->destroy;
|
||||||
redirect uri_for('/inventory');
|
redirect uri_for('/inventory')->path;
|
||||||
};
|
};
|
||||||
|
|
||||||
true;
|
true;
|
||||||
|
|||||||
Reference in New Issue
Block a user