lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.46 vs lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.47
- old
+ new
@@ -92,19 +92,19 @@
@token_data = if options.is_a?(Hash) && options[:data]
options[:data]
else
[
{
- 'iss' => 'rspeckled',
- 'own' => instance['account_id'] || instance['id'],
- 'sub' => options[:subject] || instance.class.name,
- 'aud' => 'rspec',
- 'exp' => 1.day.from_now.utc.to_i,
- 'nbf' => 1.day.ago.utc.to_i,
+ 'aid' => options[:audience_id] || instance['account_id'] || instance['id'],
+ 'aud' => options[:audience] || instance.class.name,
+ 'exp' => options[:expired_at] || 1.day.from_now.utc.to_i,
'iat' => Time.now.utc.to_i,
+ 'iss' => options[:issuer] || 'rspeckled',
'jti' => SecureRandom.uuid,
- 'sid' => options[:subject_id] || instance['account_id'] || instance['id'],
+ 'nbf' => 1.day.ago.utc.to_i,
'rol' => options[:roles] || 'standard',
+ 'sid' => options[:subject_id],
+ 'sub' => options[:subject],
},
{
'typ' => 'JWT',
'cty' => 'application/json-web-token',
},