sf-gdrive 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/gdrive/drive_controller.rb +13 -5
- data/app/views/gdrive/drive/index.html.erb +2 -0
- data/lib/gdrive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1621f24a75c22f6bab7ad05adb924df7fb64904
|
4
|
+
data.tar.gz: b96f1a3b2918b368e7ee33a09c9195df09c1bb00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0bf3abe215b0a6cc22ecef889a0913a7db5e1a36dc5fdb8df810482febf05bcecbe4a8c088c46e617d82827c094f6be5d471e4fc603a7dd20951f5c3cc93c40
|
7
|
+
data.tar.gz: 00c28b4714c9e186a7d1995ac4e2eac2035b7e3ac349226b9e573ec305947ea0df460311fc48d89c3909064220651481f196804e9be999a56f80fddc85377558
|
@@ -18,11 +18,19 @@ module Gdrive
|
|
18
18
|
else
|
19
19
|
auth_code = params[:code]
|
20
20
|
auth_client.code = auth_code
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
begin
|
22
|
+
auth_client.fetch_access_token!
|
23
|
+
secret_hash = auth_client.as_json.slice("expiry", "refresh_token", "access_token")
|
24
|
+
if secret_hash[:refresh_token] == nil
|
25
|
+
@error = 'You have already authorized this application. In order to re-configure, go to https://myaccount.google.com/permissions and revoke access to "Standard File".'
|
26
|
+
else
|
27
|
+
secret_hash[:expires_at] = auth_client.expires_at
|
28
|
+
secret = Base64.encode64(secret_hash.to_json)
|
29
|
+
@secret_url = "#{Gdrive.mount_url}/sync?key=#{secret}"
|
30
|
+
end
|
31
|
+
rescue
|
32
|
+
redirect_to(Gdrive.mount_url)
|
33
|
+
end
|
26
34
|
end
|
27
35
|
end
|
28
36
|
|
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
<p>That's it! Now, whenever you make changes to a note or tag, it will automatically be synced to your Drive.<p>
|
20
20
|
|
21
|
+
<% elsif @error %>
|
22
|
+
<strong style="color: red;">Error:</strong> <%= @error %>
|
21
23
|
<% else %>
|
22
24
|
<a href="<%= @auth_uri %>">Link Google Drive</a>
|
23
25
|
<% end %>
|
data/lib/gdrive/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sf-gdrive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "@StandardNotes"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|