hassamali

hassamali

Pow session path not working

i tried to register with pow route its working but when i am trying to sign out with pow session with method delete its not working and complaining

no route found for GET /session (QazalbashWeb.Router)

with the pow and session these are only available routes

pow_session_path  GET     /session/new                             Pow.Phoenix.SessionController :new
pow_session_path  POST    /session                                 Pow.Phoenix.SessionController :create
pow_session_path  DELETE  /session                                 Pow.Phoenix.SessionController :delete

What i am doing on the front-end is this, Register is working fine but not sign out

<%= link "Sign Out", to: Routes.pow_session_path(@conn, :delete), method: :delete  %>
<%= link "Register", to: Routes.pow_registration_path(@conn, :new) %>

Marked As Solved

hassamali

hassamali

Make sure that you got import "phoenix_html" in your JS, and restart the server if necessary. This is just a default Phoenix HTML anchor link, and will work as long as the JS is enabled and priv/static/phoenix_html.js has been loaded into your build tools.

Also Liked

wowlixir

wowlixir

Hmm, how do I know if that is the case? I just checked and I do have import "phoenix_html" in my app.js (which is loaded in my layout template file), as well as "dependencies": { "phoenix": "file:../deps/phoenix", "phoenix_html": "file:../deps/phoenix_html" } in my package.json, but I don’t see phoenix_html.js in my priv/static.

Edit: Oh, if you mean deps/phoenix_html/priv/static/phoenix_html.js, then yes, it was already there.

Last Post!

joe

joe

For me the problem originated in having a PWA. Somehow the POST requests were transformed to GET requests because it was trying to open them in the other (native) app. Unfortunately that behaviour is only present if firefox is my default browser on Android. So the only workaround I found was to make Chrome the default browser again.

Where Next?

Popular in Questions Top

minhajuddin
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
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
PeterCarter
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
aalberti333
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
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

Other popular topics Top

ashish173
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
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
siddhant3030
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
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement