I try to config the omniauth-google-oauth2
with devise
in my Rails app:
config.omniauth :google_oauth2, GOOGLE_APP_ID, GOOGLE_APP_SECRET, {
scope: 'email, profile, plus.login',
provider_ignores_state: true,
prompt: 'select_account',
image_aspect_ratio: 'square',
image_size: 50,
skip_jwt: true
}
This work but I try to config the image_size to be larger:
image_size: 100,
or
image_size: {width: 100, height: 100},
Based on this documentation, and it doesn't work, it always returns the image url like https://lh4.googleusercontent.com/-zE4TdSazXvI/AAAAAAAAAAI/AAAAAAAAACA/jWRW9BtDAlU/s128-c/photo.jpg?sz=50
This issue was raised at Rails devise with omniauth-google-oauth2 image size does not work as well, but no result on that!
Don't tell me to write this kind of hard code:
url = "https://lh4.googleusercontent.com/-zE4TdSazXvI/AAAAAAAAAAI/AAAAAAAAACA/jWRW9BtDAlU/s128-c/photo.jpg?sz=50"
url = url.sub('?sz=50', '?sz=100')
Is there another way to achieve this?