diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-01-25 16:20:28 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-01-25 16:20:28 +0100 |
commit | ddcf8597a13ea6f03c697c78d224376ff36c7ea3 (patch) | |
tree | c8de4c1a6cd2757c52d81826280a55152da87eb3 | |
parent | bbb753ffe7a428dc4bdfef59fdd703d077aefbfb (diff) |
replace halt with raise NotAuthorized
-rw-r--r-- | lib/helper.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/helper.rb b/lib/helper.rb index bb0279e..ff5e908 100644 --- a/lib/helper.rb +++ b/lib/helper.rb @@ -9,11 +9,10 @@ helpers do end elsif !env["session"] && subjectid unless authorized?(subjectid) - throw(:halt, [401, "Not authorized.\n"]) - redirect back + raise OpenTox::NotAuthorizedError.new "Not authorized" end else - throw(:halt, [401, "Not authorized.\n"]) unless authorized?(subjectid) + raise OpenTox::NotAuthorizedError.new "Not authorized" unless authorized?(subjectid) end end |