devise_imap_authenticatable 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ module Devise
10
10
  def valid_credentials?(username, password)
11
11
  imap = new_connection
12
12
  Timeout.timeout(::Devise.imap_timeout) do
13
- imap.login username, password
13
+ imap.login bin_encode(username), bin_encode(password)
14
14
  end
15
15
  true
16
16
  rescue Net::IMAP::ResponseError, Timeout::Error
@@ -31,5 +31,11 @@ module Devise
31
31
  Net::IMAP::VERSION < "1.1.0"
32
32
  end
33
33
 
34
+ def bin_encode(string)
35
+ encoded = string.dup
36
+ encoded.force_encoding(Encoding::BINARY) if encoded.respond_to?(:force_encoding)
37
+ encoded
38
+ end
39
+
34
40
  end
35
41
  end
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module ImapAuthenticatable
3
- VERSION = "0.7.0" unless const_defined?(:VERSION)
3
+ VERSION = "0.7.1" unless const_defined?(:VERSION)
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_imap_authenticatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-12-08 00:00:00.000000000Z
13
+ date: 2012-01-09 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: devise
17
- requirement: &17142000 !ruby/object:Gem::Requirement
17
+ requirement: &27559260 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -25,10 +25,10 @@ dependencies:
25
25
  version: 1.6.0
26
26
  type: :runtime
27
27
  prerelease: false
28
- version_requirements: *17142000
28
+ version_requirements: *27559260
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rails
31
- requirement: &17141240 !ruby/object:Gem::Requirement
31
+ requirement: &27558460 !ruby/object:Gem::Requirement
32
32
  none: false
33
33
  requirements:
34
34
  - - ! '>='
@@ -39,10 +39,10 @@ dependencies:
39
39
  version: 3.2.0
40
40
  type: :runtime
41
41
  prerelease: false
42
- version_requirements: *17141240
42
+ version_requirements: *27558460
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rspec
45
- requirement: &17111200 !ruby/object:Gem::Requirement
45
+ requirement: &27557820 !ruby/object:Gem::Requirement
46
46
  none: false
47
47
  requirements:
48
48
  - - ! '>='
@@ -50,10 +50,10 @@ dependencies:
50
50
  version: '0'
51
51
  type: :development
52
52
  prerelease: false
53
- version_requirements: *17111200
53
+ version_requirements: *27557820
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: rspec-rails
56
- requirement: &17110480 !ruby/object:Gem::Requirement
56
+ requirement: &27556740 !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
59
  - - ! '>='
@@ -61,10 +61,10 @@ dependencies:
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
- version_requirements: *17110480
64
+ version_requirements: *27556740
65
65
  - !ruby/object:Gem::Dependency
66
66
  name: sqlite3
67
- requirement: &17109800 !ruby/object:Gem::Requirement
67
+ requirement: &27555520 !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
70
70
  - - ! '>='
@@ -72,7 +72,7 @@ dependencies:
72
72
  version: '0'
73
73
  type: :development
74
74
  prerelease: false
75
- version_requirements: *17109800
75
+ version_requirements: *27555520
76
76
  description: Authenticate users against an IMAP server
77
77
  email: dimitrij@blacksquaremedia.com
78
78
  executables: []