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
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
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
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.
Popular in Questions
Other popular topics
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
- #code-sync
- #javascript
- #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
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









