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
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
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
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
I am trying to implement my new.html.eex file to create new posts on my website.
new.html.eex:
<h1>Create Post</h1>
<%= ...
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
I have VueJS GUIs with the project generated using Webpack.
I have Elixir modules that will need to be used by the VueJS GUIs.
I forese...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
I have a super simple question about elixir - how would I take a file like this
foo
bar
baz
and output a new file that enumerates th...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Other popular topics
If I have a post route which an argument:
post /my_post_route/:my_param1, MyController.my_post_handler
How would get the post params ...
New
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service.
Currently when I de...
New
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
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
In templates/appointment/index.html.eex:
<%= for appointment <- @appointments do %>
<tr>
<td><%= appoi...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
Hi folks,
Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
New
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









