lib/osso/helpers/auth.rb in osso-0.0.3.4 vs lib/osso/helpers/auth.rb in osso-0.0.3.5

- old
+ new

@@ -2,19 +2,21 @@ module Osso module Helpers module Auth attr_accessor :current_scope - + def enterprise_protected!(domain = nil) return if admin_authorized? return if enterprise_authorized?(domain) + halt 401 if request.post? + redirect ENV['JWT_URL'] end - def enterprise_authorized?(domain) + def enterprise_authorized?(_domain) payload, _args = JWT.decode( token, ENV['JWT_HMAC_SECRET'], true, { algorithm: 'HS256' }, @@ -64,6 +66,6 @@ redirect request.path end end end -end \ No newline at end of file +end