devise_imap_authenticatable 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/imap'
|
2
|
+
require 'timeout'
|
2
3
|
|
3
4
|
module Devise
|
4
5
|
|
@@ -8,9 +9,11 @@ module Devise
|
|
8
9
|
|
9
10
|
def valid_credentials?(username, password)
|
10
11
|
imap = new_connection
|
11
|
-
|
12
|
+
Timeout.timeout(::Devise.imap_timeout) do
|
13
|
+
imap.login username, password
|
14
|
+
end
|
12
15
|
true
|
13
|
-
rescue Net::IMAP::ResponseError
|
16
|
+
rescue Net::IMAP::ResponseError, Timeout::Error
|
14
17
|
false
|
15
18
|
ensure
|
16
19
|
imap.try(:disconnect)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_imap_authenticatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 2
|
10
|
+
version: 0.6.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Medforth
|