fanforce-plugin-factory 0.37.0 → 0.37.1
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.
@@ -17,9 +17,9 @@ class FanforcePlugin::Sinatra
|
|
17
17
|
is_valid_key = Fanforce::API.new.get("/api_auths/is_valid_key/#{params[:api_key]}", organization_id: params[:organization_id], plugin_id: params[:plugin_id])[:result]
|
18
18
|
raise 'A different API key already exists for this addon. Please uninstall first.' if !is_valid_key
|
19
19
|
end
|
20
|
+
|
20
21
|
$Redis.set("installed:#{ff.params[:addon_type]}-#{ff.params[:addon_id]}:#{params[:organization_id]}", params[:api_key])
|
21
22
|
ff.auth(params[:api_key])
|
22
|
-
|
23
23
|
json status: 'finished-processing'
|
24
24
|
end
|
25
25
|
any '/install' do route_install(params) end
|
@@ -29,7 +29,11 @@ class FanforcePlugin::Sinatra
|
|
29
29
|
raise 'This is not a valid plugin uninstall request.' if !ff.valid_uninstall_request?(params)
|
30
30
|
api_key = $Redis.get("installed:#{ff.params[:addon_type]}-#{ff.params[:addon_id]}:#{params[:organization_id]}")
|
31
31
|
|
32
|
-
|
32
|
+
if api_key.present? and api_key != params[:api_key]
|
33
|
+
is_valid_key = Fanforce::API.new.get("/api_auths/is_valid_key/#{params[:api_key]}", organization_id: params[:organization_id], plugin_id: params[:plugin_id])[:result]
|
34
|
+
raise 'API keys must match before an addon can be uninstalled.' if !is_valid_key
|
35
|
+
end
|
36
|
+
|
33
37
|
$Redis.del("installed:#{ff.params[:addon_type]}-#{ff.params[:addon_id]}:#{params[:organization_id]}")
|
34
38
|
json status: 'finished-processing'
|
35
39
|
end
|