1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Resolved Bug Reports' started by SchmitzIT, Aug 20, 2013.

  1. SchmitzIT

    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:

    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.

  2. ManOnDaMoon

    ManOnDaMoon Well-Known Member

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

    It has to be a form, with a _xfToken hidden field. This way:
    <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
  3. SchmitzIT

    SchmitzIT Well-Known Member

    Thanks for your reply. I tried embedding the link in a form, but no love for me.
  4. ManOnDaMoon

    ManOnDaMoon Well-Known Member

    Could you provide us with the form you've setup?
  5. SchmitzIT

    SchmitzIT Well-Known Member

    We're actually trying to get this done from within a notifiication
  6. xf_phantom

    xf_phantom Well-Known Member

    That's not a bug;)

    The login and many other forms are only available via a post request
    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: Aug 20, 2013
  7. Jon W

    Jon W Well-Known Member

    Yes, it is. You just can't go to it if you are logged in.

    Also, the following will work in any template:
    <a href="{xen:link login/login, '', '_xfToken={$visitor.csrf_token_page}'}">{xen:phrase log_in}</a>
    Last edited: Aug 20, 2013
    SchmitzIT and ManOnDaMoon like this.
  8. SchmitzIT

    SchmitzIT Well-Known Member

    Thanks, Jon. It doesn't seem to work in the notice, though. It ends up with the link pointing to:


    Is that because it's a notice and not a template?
  9. Jon W

    Jon W Well-Known Member

    Apparently so. My link is actually incorrect anyway. I was thinking of something else.

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

    Just remember that the link won't work if you are logged in.
  10. SchmitzIT

    SchmitzIT Well-Known Member

    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.
  11. Jon W

    Jon W Well-Known Member

    <a href="/register">Register</a>
    SchmitzIT likes this.
  12. SchmitzIT

    SchmitzIT Well-Known Member

    Ack. Thanks for that :) I have been looking at the wrong link all the time.
  13. Jon W

    Jon W Well-Known Member

    Seems obvious when you know how, but that link isn't actually used anywhere in XenForo.

Share This Page