authralia 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authenticate/base.rb +1 -1
- data/lib/authenticated_session/base.rb +1 -1
- metadata +3 -3
- data/lib/wow_authralia.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4228a4ab22a4799ddffa6db3376677d8d65a3652e71a9ffbfa2a55170cb655ca
|
4
|
+
data.tar.gz: 9a316a3be66fbfcd320d81a1e7eb40b033f6530f6677ec4cc2023f694d037f89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95c7e15a297c0f3362577fd585aa04ac1b6bb12b19ff8766ed06ee867bf21b98d70199a26e27d328ee037f18ec03401d83d78c0cf72f26db395e5fe8ac858009
|
7
|
+
data.tar.gz: 6c7624a0a9dc224cc51417f98a59a80ff335ae4b789245b2dd67c99b8b6e736f6cbb88e6a7d9b9eaf4333afc2550d13264f9fc1bcaa3d5f9898883008ac1dd2b
|
data/lib/authenticate/base.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authralia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilang Mugni Respaty
|
@@ -38,7 +38,8 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description:
|
41
|
+
description: An authentication dedicated to Mike Tyson based on his favorite place,
|
42
|
+
Australia!
|
42
43
|
email: gilmoregarland@gmail.com
|
43
44
|
executables: []
|
44
45
|
extensions: []
|
@@ -56,7 +57,6 @@ files:
|
|
56
57
|
- lib/authralia.rb
|
57
58
|
- lib/controllers/helpers.rb
|
58
59
|
- lib/models/thydney_the_protector.rb
|
59
|
-
- lib/wow_authralia.rb
|
60
60
|
homepage: https://rubygems.org/gems/hola
|
61
61
|
licenses:
|
62
62
|
- MIT
|
data/lib/wow_authralia.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# when Mike Tyson marvel at Australia's beautiful view
|
4
|
-
|
5
|
-
# TODO: use warden
|
6
|
-
# http://railscasts.com/episodes/305-authentication-with-warden?view=asciicast
|
7
|
-
module WowAuthralia
|
8
|
-
def self.configuration
|
9
|
-
@configuration ||= Configuration.new
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.configure
|
13
|
-
yield configuration
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
class WowAuthralia::Configuration
|
19
|
-
include ActiveSupport::Configurable
|
20
|
-
|
21
|
-
config_accessor(:single_active_session) { false }
|
22
|
-
config_accessor(:expires_in) { 1.hour }
|
23
|
-
config_accessor(:resource_class_names) { [] }
|
24
|
-
end
|
25
|
-
|
26
|
-
ActiveSupport.on_load(:action_controller_base) do
|
27
|
-
include WowAuthralia::Controllers::Helpers
|
28
|
-
end
|
29
|
-
|
30
|
-
ActiveSupport.on_load(:active_record) do
|
31
|
-
include WowAuthralia::Models::ThydneyTheProtector
|
32
|
-
end
|
33
|
-
|
34
|
-
module ActionDispatch::Routing
|
35
|
-
class Mapper
|
36
|
-
def when_authticanted(resource_class_name, &block)
|
37
|
-
constraint = lambda do |request|
|
38
|
-
request.session[resource_class_name.underscore].present?
|
39
|
-
end
|
40
|
-
|
41
|
-
constraints(constraint) do
|
42
|
-
yield
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def when_unauthticanted(resource_class_name, &block)
|
47
|
-
constraint = lambda do |request|
|
48
|
-
request.session[resource_class_name.underscore].blank?
|
49
|
-
end
|
50
|
-
|
51
|
-
constraints(constraint) do
|
52
|
-
yield
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|