Commit b912a808 authored by Jose Ernesto Suarez's avatar Jose Ernesto Suarez

fix problem with temporal credenntials

parent 16283b64
...@@ -59,9 +59,17 @@ module Wedoops ...@@ -59,9 +59,17 @@ module Wedoops
json_key_io: File.open(@credentials_file_path), json_key_io: File.open(@credentials_file_path),
scope: @scopes) scope: @scopes)
else else
file = Tempfile.new(user_id)
begin
file.write(@credentials_json)
@credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( @credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
json_key_io: @credentials_json, json_key_io: File.open(file),
scope: @scopes) scope: @scopes)
ensure
file.close
file.unlink # deletes the temp file
end
end end
@credentials.sub = user_id @credentials.sub = user_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment