diff options
-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 |