Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

AUTH_URL is always set to ML Brasil #10

Open
lubc opened this issue Oct 12, 2016 · 3 comments
Open

AUTH_URL is always set to ML Brasil #10

lubc opened this issue Oct 12, 2016 · 3 comments

Comments

@lubc
Copy link

lubc commented Oct 12, 2016

It seems that it's not possible to dynamically change the auth_url setting because it's always using the value in config.yml.

I’m using this gem in an application with users from different countries (AR, CL, MX, CO), so I have one ML app for each of those countries.

But after running meli.auth_url(callback) it never works because auth_url is always pointing to Brasil, and none of my ML Applications are from there.

$ meli_client.auth_url(callback)
=> "https://auth.mercadolivre.com.br/authorization?client_id=…"

I think that one solution could be that the initialize method in meli.rb could take an extra param for this purpose. With that, the auth_url inside the config.yml would just act as the default value.

@r1goo
Copy link

r1goo commented Feb 24, 2017

hi there!
I've been experiencing the same issue, just what i did was to overload in the class with my auth_url or creating my self a valid url.
Did you solved it already?

@lubc
Copy link
Author

lubc commented Feb 24, 2017

hi @r1goo ! yes, I did a PR to this gem with the solution but they never did the review, so it's not merged yet.
You can check it out here: #11

@r1goo
Copy link

r1goo commented Feb 25, 2017

thanks 4 your reply @lubc! I've just modify every file as your PR, but im still getting redirected to BR. I also restared the server and hardcoded this in meli.rb .
def auth_url(redirect_URI, iso_country_code = "UY")
and here

def self.auth_url_country(iso_country_code) #const_get "AUTH_URL_#{iso_country_code}" const_get "https://auth.mercadolibre.com.uy/authorization" end

Should i install any gem?

thanks in advance 4 your help bro!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants