ae_easy-login 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/README.md +374 -3
- data/doc/AeEasy.html +1 -1
- data/doc/AeEasy/Login.html +2 -2
- data/doc/AeEasy/Login/Flow.html +19 -15
- data/doc/AeEasy/Login/Plugin.html +1 -1
- data/doc/AeEasy/Login/Plugin/EnabledBehavior.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +426 -4
- data/doc/index.html +426 -4
- data/doc/top-level-namespace.html +1 -1
- data/lib/ae_easy/login/flow.rb +7 -5
- data/lib/ae_easy/login/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 636108729dcac57a209aa9d2342b07f9fb584c713f906b918686c893488ab869
|
4
|
+
data.tar.gz: 4ae1b8c3fdfffae5fd53ff090d73c655eb36f1ecec4bc81a9d36445515dae828
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50734f0607d2fe91e4de00e1f039f2e567b2a9c63cd8af5eacaba367452da13ec1766ac7916bcedc04c8953fcfd53a01f1477917a64473d117691b20ee522d7b
|
7
|
+
data.tar.gz: f7143bd160831a19fc09510217603858a8e64ed08ae5e36cc4856957457112c26d2e2bffbb58fa615ca9db4e5745f10a4d9324e8c31f6052306bf0dab1b7c35d
|
data/README.md
CHANGED
@@ -8,9 +8,380 @@
|
|
8
8
|
AeEasy login is part of AeEasy gem collection. It provides an easy way to handle login and session recovery, quite useful when scraping websites with login features and expiring sessions.
|
9
9
|
|
10
10
|
Install gem:
|
11
|
-
```
|
11
|
+
```ruby
|
12
|
+
gem install 'ae_easy-login'
|
13
|
+
```
|
12
14
|
|
13
15
|
Require gem:
|
14
|
-
```
|
16
|
+
```ruby
|
17
|
+
require 'ae_easy/login'
|
18
|
+
```
|
15
19
|
|
16
|
-
|
20
|
+
Code documentation can be found [here](http://rubydoc.org/gems/ae_easy-login/frames).
|
21
|
+
|
22
|
+
## How to implement
|
23
|
+
|
24
|
+
### Before you start
|
25
|
+
|
26
|
+
It is true that most user cases for `ae_easy-login` gem applies to websites with login pages and create sessions, so we will cover this scenario on our example.
|
27
|
+
|
28
|
+
Therefore, `ae_easy-login` gem is designed to handle **ANY** kind of session recovery, even those that doesn't requires a login form `POST` by just changing the flow from:
|
29
|
+
|
30
|
+
```
|
31
|
+
login -> login_post -> restore
|
32
|
+
```
|
33
|
+
|
34
|
+
To whatever you need like for example:
|
35
|
+
|
36
|
+
```
|
37
|
+
home -> search_page -> restore
|
38
|
+
```
|
39
|
+
|
40
|
+
Here are some user case examples that can be fixed by `ae_easy-login` gem:
|
41
|
+
|
42
|
+
* Websites that invalidate requests with fast expiring cookies created on first request.
|
43
|
+
* Websites that generates tokens on every search (either on cookies or query_params) that are required to fetch a detail page.
|
44
|
+
* Websites that expires session due inactivity.
|
45
|
+
* Websites that uses complex login flows.
|
46
|
+
* etc.
|
47
|
+
|
48
|
+
Feel confident to expirement with it until it fit all your needs.
|
49
|
+
|
50
|
+
### Adding ae_easy-login to your project
|
51
|
+
|
52
|
+
Let's assume a simple project implementing `ae_easy` like the one described on [ae_easy README.md](https://github.com/answersengine/ae_easy/blob/master/README.md) that scrapers your website.
|
53
|
+
|
54
|
+
Now lets assume your website has a login page `https://example.com/login` with a session that expires before our sample project scrape job finish, causing all remaining webpages to respond `403` HTTP response code and fail... quite the problem isn't it? Well, not anymore, `ae_easy-login` gem to the rescue!
|
55
|
+
|
56
|
+
First, let's create our base module that will contain our session validation and recovery logic, for this example, we will call it `LoginEnable` :
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
# ./lib/login_enable.rb
|
60
|
+
|
61
|
+
module LoginEnable
|
62
|
+
include AeEasy::Login::Plugin::EnabledBehavior
|
63
|
+
|
64
|
+
# Hook to initialize login_flow configuration.
|
65
|
+
def initialize_hook_login_plugin_enabled_behavior opts = {}
|
66
|
+
opts = {app_config: AeEasy::Core::Config.new(opts)}.merge opts
|
67
|
+
@login_flow = AeEasy::Login::Flow.new opts
|
68
|
+
@cookie = nil
|
69
|
+
end
|
70
|
+
|
71
|
+
# Get cookie after applying response cookie.
|
72
|
+
# @return [String] Cookie string.
|
73
|
+
def cookie
|
74
|
+
return @cookie if @cookie.nil?
|
75
|
+
|
76
|
+
raw_cookie = page['response_cookie'] || page['response_headers']['Set-Cookie']
|
77
|
+
@cookie = AeEasy::Core::Helper::Cookie.update(page['headers']['Cookie'], raw_cookie)
|
78
|
+
@cookie
|
79
|
+
end
|
80
|
+
|
81
|
+
# Validates session.
|
82
|
+
# @return [Boolean] `true` when session is valid, else `false`.
|
83
|
+
def valid_session?
|
84
|
+
['200', '404'].include? page['response_status_code'].to_s.strip
|
85
|
+
end
|
86
|
+
|
87
|
+
# Fix page session when session is invalid.
|
88
|
+
# @return [Boolean] `true` when session is valid, else `false`.
|
89
|
+
def fix_session
|
90
|
+
return true if valid_session?
|
91
|
+
|
92
|
+
login_flow.fix_session do
|
93
|
+
save_pages [{
|
94
|
+
'url' => 'https://example.com/login',
|
95
|
+
'page_type' => 'login',
|
96
|
+
'priority' => 9,
|
97
|
+
'freshness' => Time.now.iso8601,
|
98
|
+
'cookie' => "stl=#{salt}",
|
99
|
+
'headers' => {
|
100
|
+
# Add any extra header you need here
|
101
|
+
'Cookie' => "stl=#{salt}"
|
102
|
+
}
|
103
|
+
}]
|
104
|
+
end
|
105
|
+
|
106
|
+
false
|
107
|
+
end
|
108
|
+
end
|
109
|
+
```
|
110
|
+
|
111
|
+
Notice that our example `valid_session` method uses `200` and `404` HTTP response codes to validate that our session hasn't expired yet, therefore, **_this might not be the case for your website_**, so make sure to modify this method to fit your needs.
|
112
|
+
|
113
|
+
Our `fix_session` method will store any page with a failed session by creating an output so it can be restored later once we have the new active session cookie.
|
114
|
+
|
115
|
+
`fix_session` method will also mark the current session cookie as expired and **_enqueue a new `login` page with HIGH priority as long as another parser hasn't already did it to avoid duplicates_**.
|
116
|
+
|
117
|
+
`cookie` method will merge the request cookies with the response cookies, so we can be sure that the cookies are always updated when needed.
|
118
|
+
|
119
|
+
Next step is to create a simple parser that enqueue the `POST` of our login page:
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
# ./parsers/login.rb
|
123
|
+
|
124
|
+
module Parsers
|
125
|
+
class Login
|
126
|
+
include AeEasy::Core::Plugin::Parser
|
127
|
+
include LoginEnable
|
128
|
+
|
129
|
+
def parse
|
130
|
+
pages << {
|
131
|
+
'url' => 'http://example.com/login',
|
132
|
+
'page_type' => 'login_post',
|
133
|
+
'priority' => 10,
|
134
|
+
'method' => 'POST',
|
135
|
+
'cookie' => cookie,
|
136
|
+
'headers' => {
|
137
|
+
# Add any extra header you need here
|
138
|
+
'Cookie' => cookie
|
139
|
+
}
|
140
|
+
}
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
```
|
145
|
+
|
146
|
+
Now let's handle the login response, seed and restore any page with an expired session:
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
# ./parsers/login_post.rb
|
150
|
+
|
151
|
+
module Parsers
|
152
|
+
class LoginPost
|
153
|
+
include AeEasy::Core::Plugin::Parser
|
154
|
+
include LoginEnable
|
155
|
+
|
156
|
+
def seed!
|
157
|
+
return if login_flow.seeded?
|
158
|
+
|
159
|
+
Seeders::Seeder.new(context: context).seed do |new_page|
|
160
|
+
login_flow.fix_page! new_page
|
161
|
+
end
|
162
|
+
|
163
|
+
login_flow.seeded!
|
164
|
+
end
|
165
|
+
|
166
|
+
def parse
|
167
|
+
login_flow.update_config(
|
168
|
+
'cookie' => get_cookie,
|
169
|
+
'expired' => false
|
170
|
+
)
|
171
|
+
|
172
|
+
# Wait for any pending fetch to be hold
|
173
|
+
sleep 10
|
174
|
+
|
175
|
+
login_flow.restore_held_pages
|
176
|
+
seed!
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
```
|
181
|
+
|
182
|
+
Notice something interesting? that's right, the seeding happens **AFTER** we got our new active session cookie, so the pages we seed includes the session cookie. We use `login_flow.fix_page!` method to add our latest active session cookie along some internal `page['vars']` (used to handle page recovery) to our seeded pages.
|
183
|
+
|
184
|
+
**IMPORTANT:** This example assumes that `login_post` pages will never fails, but you might need to add some extra validations to make sure the login attempt was successful before restoring your pages.
|
185
|
+
|
186
|
+
**_Note:_** This example assumes that all pages to be seeded requires an active session, so we will add it to all pages we seed, but this will likely not apply to all pages to be seeded in a real life scenario, so make sure to add it only to those pages that requires an active session.
|
187
|
+
|
188
|
+
So next step is to modify our seeder so it allow the cookie inclusion by adding a `block` param that will be used by our `Parsers::LoginPost#seed!` method:
|
189
|
+
|
190
|
+
```ruby
|
191
|
+
# ./seeder/seeder.rb
|
192
|
+
|
193
|
+
module Seeder
|
194
|
+
class Seeder
|
195
|
+
include AeEasy::Core::Plugin::Seeder
|
196
|
+
|
197
|
+
def seed &block
|
198
|
+
new_page = {
|
199
|
+
'url' => 'https://example.com/login.rb?query=food',
|
200
|
+
'page_type' => 'search'
|
201
|
+
}
|
202
|
+
block.call(page) unless block.nil?
|
203
|
+
pages << new_page
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
```
|
208
|
+
|
209
|
+
Now we will need to create a new seeder to seed login page:
|
210
|
+
|
211
|
+
```ruby
|
212
|
+
# ./seeder/login.rb
|
213
|
+
|
214
|
+
module Seeder
|
215
|
+
class Login
|
216
|
+
include AeEasy::Core::Plugin::Seeder
|
217
|
+
|
218
|
+
def seed
|
219
|
+
pages << {
|
220
|
+
'url' => 'https://example.com/login',
|
221
|
+
'page_type' => 'login',
|
222
|
+
'priority' => 9
|
223
|
+
}
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
```
|
228
|
+
|
229
|
+
Now let's modify our `./config.yaml` to add our new page types on it, as well as let us parse failed fetched pages since our example assumes that website will return `403` HTTP response code when session has expired:
|
230
|
+
|
231
|
+
```yaml
|
232
|
+
# ./config.yaml
|
233
|
+
|
234
|
+
parse_failed_pages: true
|
235
|
+
|
236
|
+
seeder:
|
237
|
+
file: ./router/seeder.rb
|
238
|
+
disabled: false
|
239
|
+
|
240
|
+
parsers:
|
241
|
+
- page_type: search
|
242
|
+
file: ./router/parser.rb
|
243
|
+
disabled: false
|
244
|
+
- page_type: product
|
245
|
+
file: ./router/parser.rb
|
246
|
+
disabled: false
|
247
|
+
- page_type: login
|
248
|
+
file: ./router/parser.rb
|
249
|
+
disabled: false
|
250
|
+
- page_type: login_post
|
251
|
+
file: ./router/parser.rb
|
252
|
+
disabled: false
|
253
|
+
```
|
254
|
+
|
255
|
+
And don't forget to modify `./ae_easy.yaml` to add our new routes and change our seeder so login page can be seed first instead of our old seeder:
|
256
|
+
|
257
|
+
```yaml
|
258
|
+
# ./ae_easy.yaml
|
259
|
+
|
260
|
+
router:
|
261
|
+
parser:
|
262
|
+
routes:
|
263
|
+
- page_type: search
|
264
|
+
class: Parsers::Search
|
265
|
+
- page_type: product
|
266
|
+
class: Parsers::Product
|
267
|
+
- page_type: login
|
268
|
+
class: Parsers::Login
|
269
|
+
- page_type: login_post
|
270
|
+
class: Parsers::LoginPost
|
271
|
+
|
272
|
+
seeder:
|
273
|
+
routes:
|
274
|
+
- class: Seeder::Login
|
275
|
+
```
|
276
|
+
|
277
|
+
Now, let's will need to modify our routers as well since we modified our `ae_easy.yaml` routes and added new classes:
|
278
|
+
|
279
|
+
```ruby
|
280
|
+
# ./router/seeder.rb
|
281
|
+
|
282
|
+
require 'ae_easy/router'
|
283
|
+
require './seeder/login'
|
284
|
+
|
285
|
+
AeEasy::Router::Seeder.new.route context: self
|
286
|
+
```
|
287
|
+
|
288
|
+
```ruby
|
289
|
+
# ./router/parser.rb
|
290
|
+
|
291
|
+
require 'cgi'
|
292
|
+
require 'ae_easy/router'
|
293
|
+
require 'ae_easy/login'
|
294
|
+
require './lib/login_enable'
|
295
|
+
require './seeder/seeder'
|
296
|
+
require './parsers/search'
|
297
|
+
require './parsers/product'
|
298
|
+
require './parsers/login'
|
299
|
+
require './parsers/login_post'
|
300
|
+
|
301
|
+
AeEasy::Router::Parser.new.route context: self
|
302
|
+
```
|
303
|
+
|
304
|
+
Next, we need to include our `LoginEnable` module on every parser that requires session validation to fix any expired session request. To do this, we will be using our `LoginEnable#fix_session` function as the first thing to do on each parser's `parse` method:
|
305
|
+
|
306
|
+
```ruby
|
307
|
+
# ./parsers/search.rb
|
308
|
+
|
309
|
+
module Parsers
|
310
|
+
class Search
|
311
|
+
include AeEasy::Core::Plugin::Parser
|
312
|
+
include LoginEnable
|
313
|
+
|
314
|
+
def parse
|
315
|
+
return unless fix_session
|
316
|
+
|
317
|
+
html = Nokogiri.HTML content
|
318
|
+
html.css('.name').each do |element|
|
319
|
+
name = element.text.strip
|
320
|
+
pages << {
|
321
|
+
'url' => "https://example.com/product/#{CGI::escape name}",
|
322
|
+
'page_type' => 'product',
|
323
|
+
'vars' => {'name' => name}
|
324
|
+
}
|
325
|
+
end
|
326
|
+
end
|
327
|
+
end
|
328
|
+
end
|
329
|
+
```
|
330
|
+
|
331
|
+
```ruby
|
332
|
+
# ./parsers/product.rb
|
333
|
+
|
334
|
+
module Parsers
|
335
|
+
class Product
|
336
|
+
include AeEasy::Core::Plugin::Parser
|
337
|
+
include LoginEnable
|
338
|
+
|
339
|
+
def parse
|
340
|
+
return unless fix_session
|
341
|
+
|
342
|
+
html = Nokogiri.HTML content
|
343
|
+
description = html.css('.description').first.text.strip
|
344
|
+
outputs << {
|
345
|
+
'_collection' => 'product',
|
346
|
+
'name' => page['vars']['name'],
|
347
|
+
'description' => description
|
348
|
+
}
|
349
|
+
end
|
350
|
+
end
|
351
|
+
end
|
352
|
+
```
|
353
|
+
|
354
|
+
**_Note:_** This example asumes that all pages requires an active session, so we will add it to all parsers, but this will likely not apply to all parsers in a real life scenario since not all web pages will require session, so make sure to add it to only the parsers that needs it.
|
355
|
+
|
356
|
+
Finally, we need to make sure that every page that requires an active session is enqueued within our latest active session cookie, so we need to use `login_flow.fix_page!` method on all pages to be enqueued that applies.
|
357
|
+
|
358
|
+
As for this example, we already add it to our search pages enqueued by our seeder, so the only place left to modify is `./parsers/search.rb` parser since it enqueues `product` pages:
|
359
|
+
|
360
|
+
```ruby
|
361
|
+
# ./parsers/search.rb
|
362
|
+
|
363
|
+
module Parsers
|
364
|
+
class Search
|
365
|
+
include AeEasy::Core::Plugin::Parser
|
366
|
+
include LoginEnable
|
367
|
+
|
368
|
+
def parse
|
369
|
+
return unless fix_session
|
370
|
+
|
371
|
+
html = Nokogiri.HTML content
|
372
|
+
html.css('.name').each do |element|
|
373
|
+
name = element.text.strip
|
374
|
+
new_page = {
|
375
|
+
'url' => "https://example.com/product/#{CGI::escape name}",
|
376
|
+
'page_type' => 'product',
|
377
|
+
'vars' => {'name' => name}
|
378
|
+
}
|
379
|
+
login_flow.fix_page! new_page
|
380
|
+
pages << new_page
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
end
|
385
|
+
```
|
386
|
+
|
387
|
+
Hurray! Now you have implemented a fully functional login flow with auto recovery capabilities on your project.
|
data/doc/AeEasy.html
CHANGED
@@ -107,7 +107,7 @@
|
|
107
107
|
</div>
|
108
108
|
|
109
109
|
<div id="footer">
|
110
|
-
Generated on
|
110
|
+
Generated on Wed Oct 23 21:36:55 2019 by
|
111
111
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
112
112
|
0.9.20 (ruby-2.5.3).
|
113
113
|
</div>
|
data/doc/AeEasy/Login.html
CHANGED
@@ -120,7 +120,7 @@
|
|
120
120
|
|
121
121
|
</div>
|
122
122
|
</dt>
|
123
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.
|
123
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>0.0.3</span><span class='tstring_end'>'</span></span></pre></dd>
|
124
124
|
|
125
125
|
</dl>
|
126
126
|
|
@@ -136,7 +136,7 @@
|
|
136
136
|
</div>
|
137
137
|
|
138
138
|
<div id="footer">
|
139
|
-
Generated on
|
139
|
+
Generated on Wed Oct 23 21:36:56 2019 by
|
140
140
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
141
141
|
0.9.20 (ruby-2.5.3).
|
142
142
|
</div>
|
data/doc/AeEasy/Login/Flow.html
CHANGED
@@ -1590,18 +1590,22 @@ held it for fix and enqueue login page by executing block.</p>
|
|
1590
1590
|
237
|
1591
1591
|
238
|
1592
1592
|
239
|
1593
|
-
240
|
1593
|
+
240
|
1594
|
+
241
|
1595
|
+
242</pre>
|
1594
1596
|
</td>
|
1595
1597
|
<td>
|
1596
1598
|
<pre class="code"><span class="info file"># File 'lib/ae_easy/login/flow.rb', line 231</span>
|
1597
1599
|
|
1598
1600
|
<span class='kw'>def</span> <span class='id identifier rubyid_fix_page!'>fix_page!</span> <span class='id identifier rubyid_held_page'>held_page</span>
|
1599
1601
|
<span class='id identifier rubyid_clean_page_response!'>clean_page_response!</span> <span class='id identifier rubyid_held_page'>held_page</span>
|
1600
|
-
<span class='id identifier
|
1601
|
-
<span class='id identifier
|
1602
|
-
<span class='
|
1603
|
-
|
1604
|
-
<span class='
|
1602
|
+
<span class='id identifier rubyid_cookie_key'>cookie_key</span> <span class='op'>=</span> <span class='id identifier rubyid_held_page'>held_page</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:cookie</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='symbol'>:cookie</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cookie</span><span class='tstring_end'>'</span></span>
|
1603
|
+
<span class='id identifier rubyid_headers_key'>headers_key</span> <span class='op'>=</span> <span class='id identifier rubyid_held_page'>held_page</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:headers</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='symbol'>:headers</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>headers</span><span class='tstring_end'>'</span></span>
|
1604
|
+
<span class='id identifier rubyid_held_page'>held_page</span><span class='lbracket'>[</span><span class='id identifier rubyid_cookie_key'>cookie_key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_merge_cookie'>merge_cookie</span> <span class='id identifier rubyid_held_page'>held_page</span><span class='lbracket'>[</span><span class='id identifier rubyid_cookie_key'>cookie_key</span><span class='rbracket'>]</span>
|
1605
|
+
<span class='id identifier rubyid_held_page'>held_page</span><span class='lbracket'>[</span><span class='id identifier rubyid_headers_key'>headers_key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='kw'>unless</span> <span class='id identifier rubyid_held_page'>held_page</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span> <span class='id identifier rubyid_headers_key'>headers_key</span>
|
1606
|
+
<span class='id identifier rubyid_header_cookie_key'>header_cookie_key</span> <span class='op'>=</span> <span class='id identifier rubyid_held_page'>held_page</span><span class='lbracket'>[</span><span class='id identifier rubyid_headers_key'>headers_key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cookie</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>cookie</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Cookie</span><span class='tstring_end'>'</span></span>
|
1607
|
+
<span class='id identifier rubyid_held_page'>held_page</span><span class='lbracket'>[</span><span class='id identifier rubyid_headers_key'>headers_key</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_header_cookie_key'>header_cookie_key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_held_page'>held_page</span><span class='lbracket'>[</span><span class='id identifier rubyid_headers_key'>headers_key</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span> <span class='id identifier rubyid_header_cookie_key'>header_cookie_key</span>
|
1608
|
+
<span class='id identifier rubyid_held_page'>held_page</span><span class='lbracket'>[</span><span class='id identifier rubyid_headers_key'>headers_key</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_header_cookie_key'>header_cookie_key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_merge_cookie'>merge_cookie</span> <span class='id identifier rubyid_held_page'>held_page</span><span class='lbracket'>[</span><span class='id identifier rubyid_headers_key'>headers_key</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_header_cookie_key'>header_cookie_key</span><span class='rbracket'>]</span>
|
1605
1609
|
<span class='id identifier rubyid_add_vars!'>add_vars!</span> <span class='id identifier rubyid_held_page'>held_page</span>
|
1606
1610
|
<span class='id identifier rubyid_custom_fix!'>custom_fix!</span> <span class='id identifier rubyid_held_page'>held_page</span>
|
1607
1611
|
<span class='kw'>end</span></pre>
|
@@ -1639,8 +1643,6 @@ held it for fix and enqueue login page by executing block.</p>
|
|
1639
1643
|
<pre class="lines">
|
1640
1644
|
|
1641
1645
|
|
1642
|
-
244
|
1643
|
-
245
|
1644
1646
|
246
|
1645
1647
|
247
|
1646
1648
|
248
|
@@ -1664,10 +1666,12 @@ held it for fix and enqueue login page by executing block.</p>
|
|
1664
1666
|
266
|
1665
1667
|
267
|
1666
1668
|
268
|
1667
|
-
269
|
1669
|
+
269
|
1670
|
+
270
|
1671
|
+
271</pre>
|
1668
1672
|
</td>
|
1669
1673
|
<td>
|
1670
|
-
<pre class="code"><span class="info file"># File 'lib/ae_easy/login/flow.rb', line
|
1674
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/login/flow.rb', line 246</span>
|
1671
1675
|
|
1672
1676
|
<span class='kw'>def</span> <span class='id identifier rubyid_fix_session'>fix_session</span> <span class='op'>&</span><span class='id identifier rubyid_enqueue_login'>enqueue_login</span>
|
1673
1677
|
<span class='comment'># Expire cookie when same as current page
|
@@ -2345,8 +2349,6 @@ whenever `nil`.</p>
|
|
2345
2349
|
<pre class="lines">
|
2346
2350
|
|
2347
2351
|
|
2348
|
-
272
|
2349
|
-
273
|
2350
2352
|
274
|
2351
2353
|
275
|
2352
2354
|
276
|
@@ -2365,10 +2367,12 @@ whenever `nil`.</p>
|
|
2365
2367
|
289
|
2366
2368
|
290
|
2367
2369
|
291
|
2368
|
-
292
|
2370
|
+
292
|
2371
|
+
293
|
2372
|
+
294</pre>
|
2369
2373
|
</td>
|
2370
2374
|
<td>
|
2371
|
-
<pre class="code"><span class="info file"># File 'lib/ae_easy/login/flow.rb', line
|
2375
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/login/flow.rb', line 274</span>
|
2372
2376
|
|
2373
2377
|
<span class='kw'>def</span> <span class='id identifier rubyid_restore_held_pages'>restore_held_pages</span>
|
2374
2378
|
<span class='id identifier rubyid_current_page'>current_page</span> <span class='op'>=</span> <span class='int'>1</span>
|
@@ -2575,7 +2579,7 @@ whenever `nil`.</p>
|
|
2575
2579
|
</div>
|
2576
2580
|
|
2577
2581
|
<div id="footer">
|
2578
|
-
Generated on
|
2582
|
+
Generated on Wed Oct 23 21:36:56 2019 by
|
2579
2583
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2580
2584
|
0.9.20 (ruby-2.5.3).
|
2581
2585
|
</div>
|