ueberauth / ueberauth_example

Example Phoenix application using Überauth for authentication
http://ueberauth-example.herokuapp.com
MIT License
220 stars 73 forks source link

DELETE logout redirection #29

Closed phtrivier closed 4 years ago

phtrivier commented 7 years ago

When logging out, the example code uses a DELETE request, finished by a redirect:

  def delete(conn, _params) do
    conn
    |> put_flash(:info, "You have been logged out!")
    |> configure_session(drop: true)
    |> redirect(to: "/")
  end

In my situation, this causes an error (it seems like phx is trying to redirect to 'DELETE /', which of course is not defined.)

application=plug ][info] DELETE /
[application=plug ][debug] ** (Phoenix.Router.NoRouteError) no route found for DELETE / (Redacted.Web.Router)
    (redacted) lib/redacted/web/router.ex:1: Redacted.Web.Router.__match_route__/4
    (redacted) lib/phoenix/router.ex:302: Redacted.Web.Router.call/2
    (redacted) lib/redacted/web/endpoint.ex:1: Redacted.Web.Endpoint.plug_builder_call/2
    (redacted) lib/plug/debugger.ex:123: Redacted.Web.Endpoint."call (overridable 3)"/2
    (redacted) lib/redacted/web/endpoint.ex:1: Redacted.Web.Endpoint.call/2
    (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4  

Is it expected ? I have a route set up for GET / (but it assumes the user is authenticated. Could that be the problem ?)

doomspork commented 7 years ago

@phtrivier this does not appear to be working as expected, have you tried removing your GET / route to see if that does anything?

taj commented 4 years ago

this issue seems to have been fixed, @phtrivier please let us know if this is still happening to you