model_driven_api 2.3.17 → 2.3.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/json_web_token.rb +2 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa5e1a3c1035f1a2c765dfc5969845af3c80d70a2e0063e2f42b140b636b751a
4
- data.tar.gz: 461d22a194727f614e60227f2ed886b0f8fe92e27a984ed13e8b33f5e73db2e8
3
+ metadata.gz: '0185ee834ab4556b49df71082c7cff31f834e8c5a434f0add47763f8b4e3a0b5'
4
+ data.tar.gz: d0731f1d3485921ce34250f91e50ece42c4d1bc0a35378b881b24d6c711b9a31
5
5
  SHA512:
6
- metadata.gz: a401038c58d3bf9386e5020b4552040a013c5c6867c2df16ae831ebaf90ae7c22a0ed75187bd2f09fcadf00d48958ec314e288fe74767471d2432eaef6f95e39
7
- data.tar.gz: 4b03ebfbc44d9158198f1a455a5a294a5436e31af3488714b0a0fd153771aa38f2907d613a4b76a552dcbf463a6c6969821bac3a79a77e4777fd0be5b86dc745
6
+ metadata.gz: 3558a4190736978ac74b84c43887907cde12785439bef08e18edd85b2c334e5d30e79b8b1c649552fc07ea20026d0da9c5167c796fbfcfd2b814fb1a7f25682a
7
+ data.tar.gz: 8bf646ed0e69761256895e60dffefa2c320d2bf6535ba0659c49e7f8d14107fafaa9ae53caeba31fb247364174cbfa52341c891d407b6c8cd62d2e88c6bebd42
@@ -3,7 +3,8 @@ class JsonWebToken
3
3
  def encode(payload, expiry = 15.minutes.from_now.to_i)
4
4
  result = ::JWT.encode(payload.merge(exp: expiry), ::Rails.application.credentials.dig(:secret_key_base).presence||ENV["SECRET_KEY_BASE"])
5
5
  # Store the created token into the DB for later checks if is invalid
6
- UsedToken.create(token: result, user_id: payload[:user_id])
6
+ # In a public environment management, without login, it has no interest, so I don't pollute the DB
7
+ UsedToken.find_or_create_by(token: result, user_id: payload[:user_id]) if ENV["ALLOW_MULTISESSIONS"] == "false"
7
8
  result
8
9
  end
9
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.17
4
+ version: 2.3.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni