http_base_auth 0.0.2.2 → 0.0.2.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.
@@ -1,15 +1,22 @@
1
1
  module HttpBaseAuth
2
2
 
3
- def require_authentication
4
- session[:authenticated] = true if authentication
5
- logger.info '***********************'
6
- end
7
-
8
- def authentication
9
- authenticate_or_request_with_http_basic do |username, password|
10
- username == "fxposter" && password == "ek9PClkU8dAITa"
3
+ def reset_authentication
4
+ authentication.reset
5
+ end
6
+
7
+ def process_authentication
8
+ if authentication.required?
9
+ authenticate_or_request_with_http_basic do |username, password|
10
+ authentication.validate(username, password)
11
+ end
12
+ else
13
+ true
14
+ end
15
+ end
16
+
17
+ def authentication
18
+ @authentication ||= CookiesAuthentication.new(Rails.application.config.auth, cookies)
11
19
  end
12
- end
13
20
  end
14
21
 
15
22
  class ActionController::Base
@@ -1,3 +1,3 @@
1
1
  module HttpBaseAuth
2
- VERSION = "0.0.2.2"
2
+ VERSION = "0.0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_base_auth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 67
4
+ hash: 65
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 2
10
- - 2
11
- version: 0.0.2.2
10
+ - 3
11
+ version: 0.0.2.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Macj