Skip to content

Commit 2786de2

Browse files
committed
Get refresh token always
1 parent d9a7c59 commit 2786de2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/omniauth/strategies/wix.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ class Wix < OmniAuth::Strategies::OAuth2
1313
option :provider_ignores_state, true
1414

1515
uid { request.params["instanceId"] }
16+
17+
credentials do
18+
hash = {"token" => access_token.token}
19+
hash["refresh_token"] = access_token.refresh_token if access_token.refresh_token
20+
hash["expires_at"] = access_token.expires_at if access_token.expires?
21+
hash["expires"] = access_token.expires?
22+
hash
23+
end
1624

1725
def client
1826
::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(options.client_options)) do |b|

lib/omniauth/wix/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Omniauth
22
module Wix
3-
VERSION = "0.1.2"
3+
VERSION = "0.1.3"
44
end
55
end

0 commit comments

Comments
 (0)