lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.2 vs lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.3
- old
+ new
@@ -21,11 +21,11 @@
name[/(?:.*::)?(\w+)\z/, 1].
gsub(/([a-z])([A-Z])/, '\1_\2').
downcase
current_class_method = if options.is_a?(Hash) && options[:method]
- options[:method]
+ options[:method] || :current_user
else
:"current_#{underscored_class_name}"
end
instance = if options.is_a?(Hash) && options[:strategy] == :instance
@@ -84,10 +84,10 @@
'exp' => 1.day.from_now.utc.to_i,
'nbf' => 1.day.ago.utc.to_i,
'iat' => Time.now.utc.to_i,
'jti' => SecureRandom.uuid,
'sid' => instance['account_id'] || instance['id'],
- 'rol' => options[:role] || 'basic',
+ 'rol' => options[:roles] || 'standard',
},
{
'typ' => 'JWT',
'cty' => 'application/json-web-token',
},