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 +4 -4
- data/lib/rails/bot/initializer_generator.rb +1 -0
- data/lib/rails/bot/version.rb +1 -1
- data/lib/templates/warden_hooks.rb +11 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed1ece577dac9841256f3fbc1892c4932764b442
|
4
|
+
data.tar.gz: 7f80d8fc79ebb2bda6e940432dfd4255b7d38f37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/rails/bot/version.rb
CHANGED
@@ -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.
|
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
|