app_rail-airtable 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/app_rail/airtable/authenticatable.rb +11 -2
- data/lib/app_rail/airtable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4042e0d7f3f72204f26f22d018c4e6fff171a76379e6961ac93511930566e43d
|
4
|
+
data.tar.gz: 95e44a95a516a1ef1afdaf14f47ff145deae55021c4b939e874033567515f234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71120e0e952456e41fb9f950d45b763306a038571694f37976c72e23824b4501bc8f87e141b765878e76dca4e438f6a12440da4112ba9803957902706865964d
|
7
|
+
data.tar.gz: 1da004d48fb6e02c0871a941423d191efcccf0b6a56d2c34123bf556e6b12756c589fab1ebca055ce6f5cd7eb0003cff19e815743bb2b7afc130bc0868674f13
|
data/Gemfile.lock
CHANGED
@@ -23,9 +23,10 @@ module AppRail
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def find_by_email_and_password(email, password)
|
26
|
-
all(filter: "AND({Email} = \"#{email}\"
|
26
|
+
user = all(filter: "AND({Email} = \"#{email}\"").first
|
27
|
+
user.valid_password? ? user : nil
|
27
28
|
end
|
28
|
-
|
29
|
+
|
29
30
|
def find_by_access_token(access_token)
|
30
31
|
all(filter: "{Access Token} = \"#{access_token}\"").first
|
31
32
|
end
|
@@ -38,6 +39,14 @@ module AppRail
|
|
38
39
|
SecureRandom.hex
|
39
40
|
end
|
40
41
|
end
|
42
|
+
|
43
|
+
def valid_password?(password)
|
44
|
+
BCrypt::Password.new(password_hash) == password
|
45
|
+
end
|
46
|
+
|
47
|
+
def password_hash
|
48
|
+
self["Password Hash"]
|
49
|
+
end
|
41
50
|
|
42
51
|
def oauth_session
|
43
52
|
{ access_token: self["Access Token"], scope: :user, refresh_token: "", token_type: :bearer, expires_in: 60000 }
|