When user is authenticated and callback (/auth/vk/callback) is called it fails to fetch user info from VK API due to the "Invalid request: v (version) is required" error.
How To Reproduce
Try authenticating by calling /auth/vk
After being redirected back to /auth/vk/callback?code=xxx it will show the error (see Stack Trace).
Stack Trace
Request: GET /auth/vk/callback?code=a55b8166fcf0135cf6
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in List.first/1
(elixir) lib/list.ex:219: List.first(nil)
(ueberauth_vk) lib/ueberauth/strategy/vk.ex:173: Ueberauth.Strategy.VK.fetch_user/3
(ueberauth) lib/ueberauth/strategy.ex:301: Ueberauth.Strategy.run_callback/2
(my_app) lib/my_app_web/controllers/auth_controller.ex:1
...
When user is authenticated and callback (/auth/vk/callback) is called it fails to fetch user info from VK API due to the "Invalid request: v (version) is required" error.
How To Reproduce
Stack Trace
The
users.get
API returns a response:Suggested Fix
|> Map.merge(%{"v" => "5.73"})
to the methoduser_query
at vk.ex solves the error.