Hey! I'm writing about this issue because while trying to implement the Google OAuth flow as documented in the README, I had an issue with the authorization_url method that's defined in NoPassword::OAuth::GoogleAuthorizationsController.
The current method definition is:
def authorization_url
AUTHORIZATION_URL.build.query(
client_id: client_id,
redirect_uri: callback_url,
response_type: "code",
scope: scope,
state: form_authenticity_token
)
end
The issue I faced is that I'm getting an "undefined method build for an instance of URI::HTTPS" error, so I had to redefine the authorization_url method with the following to make it work:
def authorization_url
url = AUTHORIZATION_URL.dup
url.query = URI.encode_www_form(
client_id: client_id,
redirect_uri: callback_url,
response_type: "code",
scope: scope,
state: form_authenticity_token
)
url
end
I wonder if this is an acceptable solution.
Thanks for working on the gem, I learned a lot by reading the code by the way.
Hey! I'm writing about this issue because while trying to implement the Google OAuth flow as documented in the README, I had an issue with the
authorization_urlmethod that's defined inNoPassword::OAuth::GoogleAuthorizationsController.The current method definition is:
The issue I faced is that I'm getting an "undefined method build for an instance of URI::HTTPS" error, so I had to redefine the
authorization_urlmethod with the following to make it work:I wonder if this is an acceptable solution.
Thanks for working on the gem, I learned a lot by reading the code by the way.