rails-bot 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '0139159d43fec6245f10835e803d79b5cfd1b3eb'
4
- data.tar.gz: b36b8d5edd3c0883c201c41b216faa9a164e8cab
3
+ metadata.gz: ed1ece577dac9841256f3fbc1892c4932764b442
4
+ data.tar.gz: 7f80d8fc79ebb2bda6e940432dfd4255b7d38f37
5
5
  SHA512:
6
- metadata.gz: 6a6159c67c785866d10f729aff1b421107f66412f3d2ee4455bea34ce1ff6742574c9921012fb39ff4583f14aa824ea5b58d144442e1cd1b0c7b88a244ba279b
7
- data.tar.gz: a9708ccdaa4cd1151c072083321c9065738f12afee2c288ff17faf146834326de74c2d53cd5062b3a35dca72d451f5bb727d347d826d0c8d78b3ee5de48b4958
6
+ metadata.gz: 555cd11a0f32e6c3de9f5cf6b58c7da406b3b565323b0f1a7e520dc70167fc9263d567ab7b8566e95d38e2494b61442c700896e82090ba88d3c7bc076360c51c
7
+ data.tar.gz: c71a551ba158936ba75d9d1de73d3a644d28e93179a5cc2c7635950b5b785e2814f266db673a7eb2924d63b49c35712d224631d135f9202bc3c8c0d6c4118567
@@ -3,6 +3,7 @@ class Rails::Bot::InitializerGenerator < Rails::Generators::Base
3
3
  def create_initializer_file
4
4
  #create_file "config/initializers/google_initializer.rb", "# Add initialization content here"
5
5
  copy_file "google_initializer.rb", "config/initializers/google_initializer.rb"
6
+ copy_file "warden_hooks.rb", "config/initializers/warden_hooks.rb"
6
7
  end
7
8
 
8
9
  def create_chat_file
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Bot
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
4
4
  end
5
5
  end
@@ -0,0 +1,11 @@
1
+ Warden::Manager.after_set_user do |user,auth,opts|
2
+ scope = opts[:scope]
3
+ auth.cookies.signed["#{scope}.id"] = user.id
4
+ auth.cookies.signed["#{scope}.expires_at"] = 30.minutes.from_now
5
+ end
6
+
7
+ Warden::Manager.before_logout do |user, auth, opts|
8
+ scope = opts[:scope]
9
+ auth.cookies.signed["#{scope}.id"] = nil
10
+ auth.cookies.signed["#{scope}.expires_at"] = nil
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Himanshu
@@ -59,6 +59,7 @@ files:
59
59
  - lib/templates/chat_channel.rb
60
60
  - lib/templates/google_initializer.rb
61
61
  - lib/templates/ruby_bot_job.rb
62
+ - lib/templates/warden_hooks.rb
62
63
  homepage: ''
63
64
  licenses:
64
65
  - MIT