Commit 8f6fcf2b authored by Jose Ernesto Suarez's avatar Jose Ernesto Suarez

Se corrige un fallo en los namespaces de librerias de google

parent bee8ceec
...@@ -21,10 +21,10 @@ module Wedoops ...@@ -21,10 +21,10 @@ module Wedoops
def auth_by_console(user_id) def auth_by_console(user_id)
puts "Authenticating from console" puts "Authenticating from console"
scope = @scopes scope = @scopes
client_id = Google::Auth::ClientId.from_file(@credentials_file_path) client_id = ::Google::Auth::ClientId.from_file(@credentials_file_path)
token_store = Google::Auth::Stores::FileTokenStore.new( token_store = ::Google::Auth::Stores::FileTokenStore.new(
:file => './tokens/tokens.yaml') :file => './tokens/tokens.yaml')
authorizer = Google::Auth::UserAuthorizer.new(client_id, scope, token_store) authorizer = ::Google::Auth::UserAuthorizer.new(client_id, scope, token_store)
credentials = authorizer.get_credentials(user_id) credentials = authorizer.get_credentials(user_id)
if credentials.nil? if credentials.nil?
...@@ -40,11 +40,11 @@ module Wedoops ...@@ -40,11 +40,11 @@ module Wedoops
end end
def auth_by_sa(user_id) def auth_by_sa(user_id)
@credentials = Google::Auth::ServiceAccountCredentials.make_creds( @credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
json_key_io: File.open(@credentials_file_path), json_key_io: File.open(@credentials_file_path),
scope: @scopes) scope: @scopes)
@credentials.sub = user_id @credentials.sub = user_id
Google::Apis::RequestOptions.default.authorization = @credentials ::Google::Apis::RequestOptions.default.authorization = @credentials
@authenticated_by="service_account" @authenticated_by="service_account"
return true return true
......
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