sudo_rails 0.4.4 → 0.5.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: 27632875a2ae396015c0197cc21d643ea90d2db2af36f58a30ca64859a42d0e7
4
- data.tar.gz: f1b1779fea508d261fbf5b3efef676c282d8f8d52fcdfae96c3e612125a5b5cc
3
+ metadata.gz: c66a5cac3194830858e3456856ddd5d25124e6309496d7766860789ff790204d
4
+ data.tar.gz: 53306beab517248b4aa56d75aaaec2dd446d3db934d761c08b0b5a1749d91c8b
5
5
  SHA512:
6
- metadata.gz: f56a17d44120ec419693ec3b31a4bf6e27bc101615e0dd22f32e73ea341644737a0e1093cfb8d14abc089b1a176981e461a891b28bd8667df285cb8e5c6a5c77
7
- data.tar.gz: b154b12993013e0a0c1cf631d7e7eb2e5ce084cd072057aabcb6512f3eb192ca492eefc7e4f17211ca3b547b1d924c0f10c8deac442159f8d846fe3a0f269ee1
6
+ metadata.gz: e0ced3873a7a304d4d00133d9b799898165e77cf4e35328541cadf17d5206e8993cc38f31f8387c52feab276f5be5c88f060b329e91bd39c114189427b8714f6
7
+ data.tar.gz: dcb5c808819fd2c954c5913254749bf1408f93e122b73997ca3221c071ca75604ab7c02d9c4e1892cbfe37b4e28959d80c065bbefe816655777f7cac152bf6cf
data/README.md CHANGED
@@ -71,6 +71,12 @@ SudoRails.setup do |config|
71
71
  end
72
72
  ```
73
73
 
74
+ ### Sudo sessions
75
+
76
+ Using the `sudo_session_duration` option you are able to configure the `sudo` session duration (30 minutes by default).
77
+
78
+ If you set it to `nil`, your `sudo` session won't expire automatically and you will have to do it manually by using the `reset_sudo_session!` helper.
79
+
74
80
  ### Styling
75
81
 
76
82
  Using the `custom_logo`, `primary_color` and `background_color` options, you can customize the confirmation page. In case you want full control of the styles, you can use your own layout (and consequently your own styles too) using the `layout` option.
@@ -18,6 +18,8 @@
18
18
  <% end %>
19
19
  </div>
20
20
 
21
- <div class='sudo-tip'>
22
- <%= t('sudo_rails.tip', session_duration: time_ago_in_words(SudoRails.sudo_session_duration.ago)).html_safe %>
23
- </div>
21
+ <% unless SudoRails.sudo_session_duration.nil? %>
22
+ <div class='sudo-tip'>
23
+ <%= t('sudo_rails.tip', session_duration: time_ago_in_words(SudoRails.sudo_session_duration.ago)).html_safe %>
24
+ </div>
25
+ <% end %>
@@ -30,6 +30,7 @@ module SudoRails
30
30
 
31
31
  def valid_sudo_session?(started_at)
32
32
  return false unless started_at
33
+ return true if sudo_session_duration.nil?
33
34
 
34
35
  DateTime.parse(started_at) + sudo_session_duration > Time.zone.now
35
36
  end
@@ -1,3 +1,3 @@
1
1
  module SudoRails
2
- VERSION = "0.4.4"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sudo_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - markets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-17 00:00:00.000000000 Z
11
+ date: 2019-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails