<p>Although your question is lacking in detail, here is a shot at helping you track down the issue. The fact that GET requests are working but POST requests are not, your form is likely missing a CSRF token. You can add it to your form using the following twig code:</p>

<pre><code>&lt;form method="post" action=""&gt;

   {{ csrfInput() }}
</code></pre>

<p>If your POST request is coming through as an AJAX request then you can create and submit a CSRF token as described in <a href="https://craftcms.stackexchange.com/a/6588/180">this answer</a>.</p>

CC BY-SA 4.0
2018-10-19T15:23:30.830Z
2018-10-19T15:23:30.830Z
Ben Croker
<p>I am developing a custom authentication plugin for Craft 3. But I can't route to my Controller via <code>POST</code> request with my login form. Request via <code>GET</code> work</p>

CC BY-SA 4.0
2018-10-17T13:03:12.710Z
Have you a problem with Csrf? Or can you specify more precisely what's your problem.
lenka
CC BY-SA 4.0
2018-10-17T18:53:01.037Z
Can you add some additional details? As your question currently stands, it's far to broad to know what the problem may be.
Lindsey D
<plugins><login><post>
plugins route post controller?
# plugins route post controller?

(Asked by: username_0 on 2018-10-17)

I am developing a custom authentication plugin for Craft 3. But I can't route to my Controller via `POST` request with my login form. Request via `GET` work

**Tags:** plugins, login, post
> **Comments:**
> **username_1**: Have you a problem with Csrf? Or can you specify more precisely what's your problem.  
> **username_2**: Can you add some additional details? As your question currently stands, it's far to broad to know what the problem may be.  

---

## 1 answers

### Answer by username_3 on 2018-10-19. Score: 1

Although your question is lacking in detail, here is a shot at helping you track down the issue. The fact that GET requests are working but POST requests are not, your form is likely missing a CSRF token. You can add it to your form using the following twig code:


   {{ csrfInput() }}

If your POST request is coming through as an AJAX request then you can create and submit a CSRF token as described in this answer.


---

