My wild guess: the @login_required decorator automatically forwards
not-logged-in users to a login url (something like
http://your-app.appspot.com/_ah/login?continue=http://your-app.appspot.com/original-url?q=params).
Once the user logs in, they get to the url they were originally
seeking and all is well.  With a POST request, the parameters
contained in the request would be lost, which would create unexpected
behavior for the application and user.

If you are using Google Account authentication and want to ensure a
POST request is authenticated, use something like this:

from google.appengine.api import users
def post(self):
  user = users.get_current_user()
  if user is None:
    # user isn't logged in
  else:
    # user is logged in

On Jun 21, 6:27 pm, Felipe Cavalcante <felipexcavalca...@gmail.com>
wrote:
> Hi,
>
> Does somebody know why "The check_login decorator can only be used for
> GET requests" ?
>
> The message above appears when I use put @login_required in the post
> methos of a webapp.RequestHandler class.
>
> -----
> Felipe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to