Sanjay Rabari
Sanjay Rabari

Reputation: 2081

post request not working in play scala appication

I am creating simple application in scala and play framework, when I use post request it is not working and it gives me "Unauthorized" , you must be authenticated to access this page,

Though I am not using any authentication yet why I am getting this error ?

on Get I am seeing login page, but after filling up form and then using post I am not able to redirect to home page

Upvotes: 0

Views: 1657

Answers (1)

L.Lampart
L.Lampart

Reputation: 755

As I stated in comment author is probably missing CSRF token: https://www.playframework.com/documentation/2.6.x/ScalaCsrf, I linked docs for play 2.6 because they tell more about usage of CSRF headers in views (which should also work in previous versions).

It may also be possible that application is accessed at wrong address, check out the following: https://www.playframework.com/documentation/2.5.x/AllowedHostsFilter.

Upvotes: 1

Related Questions