ae_easy-login 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +0,0 @@
1
- require 'ae_easy/login/plugin/enabled_behavior'
2
-
3
- module AeEasy
4
- module Login
5
- module Plugin
6
- end
7
- end
8
- end
@@ -1,47 +0,0 @@
1
- module AeEasy
2
- module Login
3
- module Plugin
4
- # Abstract module that provides a template with minimal common logic to
5
- # implement a login flow enabled plugin.
6
- # @abstract
7
- module EnabledBehavior
8
- include AeEasy::Core::Plugin::InitializeHook
9
-
10
- # Login flow tool.
11
- attr_reader :login_flow
12
-
13
- # Hook to initialize login_flow configuration.
14
- #
15
- # @param [Hash] opts ({}) Configuration options (see
16
- # AeEasy::Login::Flow#initialize_hook_login_flow).
17
- def initialize_hook_login_plugin_enabled_behavior opts = {}
18
- @login_flow = AeEasy::Login::Flow.new opts
19
- end
20
-
21
- # Generates a salt value based on the current page's login flow vars.
22
- #
23
- # @return [String]
24
- def salt
25
- old_cookie = page['vars'][login_flow.vars_key]
26
- old_cookie = '' if old_cookie.nil?
27
- Digest::SHA1.hexdigest old_cookie
28
- end
29
-
30
- # Validates that the current page's session hasn't expired.
31
- #
32
- # @return [Boolean] `true` when session is valid, else `false`.
33
- def valid_session?
34
- raise NotImplementedError.new('Must implement "session_valid?" function.')
35
- end
36
-
37
- # Fixes current page's session.
38
- #
39
- # @return [Boolean] `true` when session is valid and no need to fix,
40
- # else `false`.
41
- def fix_session
42
- raise NotImplementedError.new('Must implement "fix_session" function.')
43
- end
44
- end
45
- end
46
- end
47
- end
@@ -1,6 +0,0 @@
1
- module AeEasy
2
- module Login
3
- # Gem version
4
- VERSION = '0.0.3'
5
- end
6
- end