prax
Uberauth failed on modified route
Hello All,
I have developed Rest API authentication using ueberauth , guardian and google auth provider.
Things are working as expected if I use the same route as specified in example.
scope "/api/v0/auth/", ApiGateway do
pipe_through :api
get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
post "/:provider/callback", AuthController, :callback
end
But If I modify the route to -
scope "/api/v0/auth/", ApiGateway do
pipe_through :api
get "/persons/oauth/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
post "/:provider/callback", AuthController, :callback
end
Then getting crash on console stating :
09:07:17.724 request_id=FnxdBAD6grgL04QAAMil [info] GET /api/v0/auth/persons/oauth/google
09:07:17.726 request_id=FnxdBAD6grgL04QAAMil [debug] Processing with ApiGateway.AuthController.request/2
Parameters: %{"provider" => "google"}
Pipelines: [:api]
09:07:17.731 request_id=FnxdBAD6grgL04QAAMil [debug] Plug.Session could not verify incoming session cookie. This may happen when the session settings change or a stale cookie is sent.
09:07:17.735 request_id=FnxdBAD6grgL04QAAMil [info] Sent 500 in 11ms
09:07:17.736 [error] #PID<0.7002.0> running ApiGateway.Endpoint (connection #PID<0.6994.0>, stream id 3) terminated
Server: localhost:4000 (http)
Request: GET /api/v0/auth/persons/oauth/google
** (exit) an exception was raised:
** (RuntimeError) expected action/2 to return a Plug.Conn, all plugs must receive a connection (conn) and return a connection, got: nil
(api_gateway 0.1.0) lib/api_gateway/controllers/auth_controller.ex:1: ApiGateway.AuthController.phoenix_controller_pipeline/2
(phoenix 1.5.8) lib/phoenix/router.ex:352: Phoenix.Router.__call__/2
(api_gateway 0.1.0) lib/api_gateway/endpoint.ex:1: ApiGateway.Endpoint.plug_builder_call/2
(api_gateway 0.1.0) lib/plug/debugger.ex:136: ApiGateway.Endpoint."call (overridable 3)"/2
(api_gateway 0.1.0) lib/api_gateway/endpoint.ex:1: ApiGateway.Endpoint.call/2
(phoenix 1.5.8) lib/phoenix/endpoint/cowboy2_handler.ex:65: Phoenix.Endpoint.Cowboy2Handler.init/4
(cowboy 2.8.0) /home/prakash/git/nebula/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
(cowboy 2.8.0) /home/prakash/git/nebula/deps/cowboy/src/cowboy_stream_h.erl:300: :cowboy_stream_h.execute/3
nil
Does anyone have Idea what’s wrong here ?
Thanks! 
Popular in Questions
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
Hello, I get Persian date from my client and convert it to normal calendar like this:
def jalali_string_to_miladi_english_number(persi...
New
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project.
Baby step #1 is extracting the number ...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Hi,
I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors:
[WARN] - (starship::utils): Executing command ...
New
Other popular topics
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
Manning 2016 Halloween weekend sale via Deal of the Day
Friday, October 28 - Half off all MEAPs - code WM102816LT
Saturday, October 29 ...
New
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
I have followed this StackOverflow post to install the specific version of Erlang.
And When I am running mix ecto.setup then getting fol...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set?
Thanks.
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
New
by Lance Halvorsen
Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
New
Hi,
I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New







