insales_api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/insales_api/app.rb +3 -3
- data/lib/insales_api/version.rb +1 -1
- data/spec/lib/insales_app_spec.rb +3 -0
- metadata +3 -3
data/lib/insales_api/app.rb
CHANGED
@@ -2,7 +2,7 @@ require 'digest/md5'
|
|
2
2
|
module InsalesApi
|
3
3
|
class App
|
4
4
|
cattr_accessor :api_key, :api_host, :api_secret, :api_autologin_path
|
5
|
-
|
5
|
+
attr_reader :authorized, :auth_token, :shop, :password
|
6
6
|
|
7
7
|
def initialize(shop, password)
|
8
8
|
@authorized = false
|
@@ -16,7 +16,7 @@ module InsalesApi
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def store_auth_token
|
19
|
-
@auth_token
|
19
|
+
@auth_token ||= InsalesApi::Password.create(password, salt)
|
20
20
|
end
|
21
21
|
|
22
22
|
def salt
|
@@ -25,7 +25,7 @@ module InsalesApi
|
|
25
25
|
|
26
26
|
def authorize token
|
27
27
|
@authorized = false
|
28
|
-
if self.auth_token == token
|
28
|
+
if self.auth_token and self.auth_token == token
|
29
29
|
@authorized = true
|
30
30
|
end
|
31
31
|
|
data/lib/insales_api/version.rb
CHANGED
metadata
CHANGED