Not a bug "This action is available via POST only. Please press the back button and try again."

SchmitzIT

Well-known member
We're trying to create a shortcut for logging in. By shortcut, I mean that normally when you click the "Login or signup" link, you will be taken to a small form asking you to either login or signup. Once you click to sign up from there (even without filling in a username), it will take you to <forumhome>/login/login.

However, directly attempting to access that link yields an error:

This action is available via POST only. Please press the back button and try again.

I'm able to reproduce that error here by heading to xenforo.com/community/login/login

Is there any way to circumvent this behaviour? Seeing the username is not mandatory for the signup process, and thus no field has to be filled in, the apparent requirement for a POST doesn't make sense to me.

Cheers.
 
Isn't the correct URL xenforo.com/community/login?
Nevermind.

It has to be a form, with a _xfToken hidden field. This way:
HTML:
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
 
That's not a bug;)

The login and many other forms are only available via a post request
This action is available via POST only. Please press the back button and try again.

You'll need an addon or try to do this via ajax

i thought you're talking about a real login and not just getting to the form
 
Last edited:
Thanks, Jon. It doesn't seem to work in the notice, though. It ends up with the link pointing to:

/%7Bxen:link%20login/login,%20'',%20'_xfToken=%7B$visitor.csrf_token_page%7D'%7D

Is that because it's a notice and not a template?
 
Thanks, Jon. It doesn't seem to work in the notice, though. It ends up with the link pointing to:

/%7Bxen:link%20login/login,%20'',%20'_xfToken=%7B$visitor.csrf_token_page%7D'%7D

Is that because it's a notice and not a template?
Apparently so. My link is actually incorrect anyway. I was thinking of something else.

But you should just be fine to use:
HTML:
<a href="/login">Log In</a>
in your notice.

Just remember that the link won't work if you are logged in.
 
Actually, I just noticed I stated in my OP that we're trying to create a shortcut for logging in. It's actually a shortcut for signing up. We want to bypass the original login page, where one has to select to create a new account. The login itself is fine. It's the signup, link, where the user would straight away be taken to the screen where they fill in their information.
 
Back
Top Bottom