authralia 0.0.2 → 0.0.3
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: 414a5e20e68e0a941cfee786236b8936b20c6c501abb1c0915eb88c0d2a75ca4
|
4
|
+
data.tar.gz: 4a88420c5c8a63f744c0aa8d5a88314fd59060ec73ae717105bf6423d40a078f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19aaf48d110abd50ec78b293312c5e34ad80b23fa99af8c5c1017037398939395bc1f376af6f3113f7749e35dc90d2f7f438e71927f80bfeb07df0aaaebb27d1
|
7
|
+
data.tar.gz: a7f01ccea9d49569e61174d1d34c26885219ee1a91a296906da809dd17b6e67e419320594aa93f56d3109d84dc430a83f741fbcc1d8d25e7b5a46a921e008201
|
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.3
|
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: A authentication dedicated to Mike Tyson
|
41
|
+
description: A 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
|