queue_it 2.0.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11e2e993d7d7786358079cd70de8f3e0c5937e5b17838dbf018885aac63b3aab
4
- data.tar.gz: c96be7f3a372d1259f431fb803588a1377edee8552454572ec245c924b7d8523
3
+ metadata.gz: 37fa1c47d1ae47fffa2b3bc9b78dad1a983356b232329d8016ea14a6d0a2ecd2
4
+ data.tar.gz: e2a72cd51b72e2da2ae74f388924e59e4c2664977d8d826d2b35d1a646f4a519
5
5
  SHA512:
6
- metadata.gz: '009611414e2b920b4e3fb84a9b62fbd79957f6ba3454a966218e30c299afb051ca60afff1fa1910a852176b01e3f6d9b483b43e023913f9ec8a4ea36dd45f0e5'
7
- data.tar.gz: 452e61cfdfd7a168d752cf5e687347c45ddbc740b751160428e605a7ff7a21115572867331ff39ecaea240cee20f7d36862c80e5e4ab2f9aaa46c347d476aecc
6
+ metadata.gz: e4f59ab64f17ce5991d321bfbd59ec9d4189a00cc820e080945e58877a8e58eeb368a533a464fe3f4a05e002d889f5ee0723905caf2760cfbd421502cdd938f3
7
+ data.tar.gz: 48a90881475da361a4b1446162f612419a6c56e250ebe1750c92b504b77a0c8d97f70d5d1909dc24f7bae490a1c076ed13639a3e0c8f688d75a31dbc16035275
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 3.0.0 - 2021-07-30
2
+
3
+ * Replace session store with cookie store to prevent some users of being kicked out of the queue
4
+
1
5
  ### 2.0.2 - 2021-07-21
2
6
 
3
7
  * Defaults changed when creating/updating a queue: CustomLayout set to dark theme, MaxNoOfRedirectsPrQueueId to 3, QueueNumberValidityInMinutes to 30.
@@ -15,18 +15,18 @@ module QueueIt
15
15
  end
16
16
 
17
17
  def queue_it_queue_id(event_id)
18
- session[queue_it_session_variable(event_id)].to_i
18
+ cookies.signed[queue_it_session_variable(event_id)].to_i
19
19
  end
20
20
 
21
21
  def destroy_all_queue_it_sessions
22
22
  session_variable_prefix = queue_it_session_variable("")
23
- session.keys.select{ |session_key| session_key.start_with?(session_variable_prefix) }.each do |key|
24
- session.delete(key)
23
+ cookies.each do |key, _|
24
+ cookies.signed.delete(key) if key.starts_with?(session_variable_prefix)
25
25
  end
26
26
  end
27
27
 
28
28
  def destroy_queue_it_session(event_id)
29
- session.delete(queue_it_session_variable(event_id))
29
+ cookies.signed.delete(queue_it_session_variable(event_id))
30
30
  end
31
31
 
32
32
  def queue_it_session_variable(event_id)
@@ -37,14 +37,14 @@ module QueueIt
37
37
 
38
38
  def create_or_verify_queue_it_session(secret_key, event_id, customer_id, request_url, params, current_tickets_url)
39
39
  # If there exists a session, we return. This needs to be refactored when we start to look at the timestamp parameter
40
- return if session[queue_it_session_variable(event_id)].present?
40
+ return if cookies.signed[queue_it_session_variable(event_id)].present?
41
41
 
42
42
  begin
43
43
  queue_number = QueueIt::ExtractQueueNumber.new.(
44
44
  secret_key: secret_key,
45
45
  request_url: request_url,
46
46
  request_params: params)
47
- session[queue_it_session_variable(event_id)] = queue_number
47
+ cookies.signed[queue_it_session_variable(event_id)] = { value: queue_number, expires: 24.hours.from_now }
48
48
 
49
49
  # If the request URL contains queue_it params we remove them and redirect
50
50
  # this is done to mask the params we use to create and verify the queue_it session
@@ -1,3 +1,3 @@
1
1
  module QueueIt
2
- VERSION = "2.0.2"
2
+ VERSION = "3.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: queue_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Billetto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-21 00:00:00.000000000 Z
11
+ date: 2021-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable