Browse files

authでredirectきくように

  • Loading branch information...
1 parent eb4eac5 commit da11086d98ffdce6848d4385edf07420ce9e9862 @nekokak committed Feb 10, 2010
Showing with 8 additions and 7 deletions.
  1. +8 −7 lib/Kamui/Web/Handler.pm
View
15 lib/Kamui/Web/Handler.pm
@@ -118,15 +118,16 @@ sub dispatch {
if (my $dispatch_code = $controller->can($method)) {
- if (my $not_authorized = $controller->authorize($dispatch_code, $context)) {
- return $not_authorized;
- }
-
my $res;
eval {
- $controller->call_trigger('before_dispatch', $context, $context->dispatch_rule->{args});
- $res = $controller->$method($context, $context->dispatch_rule->{args});
- $controller->call_trigger('after_dispatch', $context, $context->dispatch_rule->{args});
+
+ if (my $not_authorized = $controller->authorize($dispatch_code, $context)) {
+ $res = $not_authorized;
+ } else {
+ $controller->call_trigger('before_dispatch', $context, $context->dispatch_rule->{args});
+ $res = $controller->$method($context, $context->dispatch_rule->{args});
+ $controller->call_trigger('after_dispatch', $context, $context->dispatch_rule->{args});
+ }
};
if ( $context->is_detach($@) ) {
return $context->res;

0 comments on commit da11086

Please sign in to comment.