add a code path for unauthorized XHR
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,2 +1,3 @@
|
||||
share/public/javascripts/*.min.js binary
|
||||
share/public/css/*.min.css binary
|
||||
share/public/swagger-ui/* binary
|
||||
|
||||
@@ -210,6 +210,11 @@ get qr{^/(?:login(?:/denied)?)?} => sub {
|
||||
return_url => param('return_url'),
|
||||
};
|
||||
}
|
||||
elsif (defined request->header('X-Requested-With')
|
||||
and request->header('X-Requested-With') eq 'XMLHttpRequest') {
|
||||
status('unauthorized');
|
||||
return '<div class="span2 alert alert-error"><i class="icon-ban-circle"></i> Error: unauthorized.</div>';
|
||||
}
|
||||
else {
|
||||
template 'index', {
|
||||
return_url => param('return_url')
|
||||
|
||||
Reference in New Issue
Block a user