lib/osso/helpers/auth.rb in osso-0.0.3.17 vs lib/osso/helpers/auth.rb in osso-0.0.3.18
- old
+ new
@@ -1,8 +1,7 @@
# frozen_string_literal: true
-require 'pry'
module Osso
module Helpers
module Auth
END_USER_SCOPE = 'end-user'
INTERNAL_SCOPE = 'internal'
@@ -10,9 +9,11 @@
attr_accessor :current_user
def token_protected!
decode(token)
+ rescue JWT::DecodeError
+ halt 401
end
def enterprise_protected!(domain = nil)
return if admin_authorized?
return if internal_authorized?