MyBB Community Forums

Full Version: Authorization code mismatch. Are you accessing this function correctly? Please go bac
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I get this message when trying to login. I have made the corrections to the theme .php files as detailed in this post:

Templates requiring changes:
  • error_nopermission

  • header_welcomeblock_guest

  • member_login

  • portal_welcome_guesttext
1. Localize form tag
Open each template and look for <form action="member.php" *>. They are the forms you use when logging in. The form tag will likely include other attributes, which you can ignore.

2. Add token
Add after <form action="member.php"> the following piece of code:

<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />


But I still get the error when I login as a user.  I notice that this was written in 2012, so is this now not relitive?
Is there another fix?
Hey!

=> Have you tried to make a new user account? If yes, do you still get the same error?
=> Are you sure that there are no active sessions no more?
Yes I created a test account, that is why I posted this!
Don’t understand what you mean in your 2nd comment?
does direct login work without showing the authentication error
forumURL/member.php?action=login

Quote:I have made the corrections to the theme .php files
have you made corrections to templates of your forum's active theme ?
exactly which version of MyBB you are using & what is your forum url ?

btw, php files are not supposed to be edited.

Quote:I notice that this was written in 2012
no, it was in 2018 [Link]. still relevant for many themes.
Clear cookies and refresh the page.
As precaution drop (truncate) all sessions in table mybb_sessions.

Do you use an alternate theme? Did you make the changes to the correct theme and all templates of all themes?
Check your source code in the browser (menu on right mouse click) and have a look at the content of login <form>. Is my_post_key actually in the code?

There's no need to make modifications on .php files at all!

[ExiTuS]
(2020-04-08, 09:52 AM)[ExiTuS] Wrote: [ -> ]As precaution drop (truncate) all sessions in table mybb_sessions.

This is what I mean with my 2nd comment :-)
1)
Quote:exactly which version of MyBB you are using & what is your forum url ?

MyBB Version: 1.8.22
PHP Version: 7.3.16
MySQL Version: 5.6.47
URL: http://www.1066mfc.co.uk/forum1.php
2)
Quote:have you made corrections to templates of your forum's active theme ?

I am using the default Template and I edited the files in Templates & Styles-.Manage Templates and choose the recommended template files as I listed above. [See attachment]
3)
Quote:As precaution drop (truncate) all sessions in table mybb_sessions.

I assume you mean that I go to mySQL and truncate there?
4)
Quote:There's no need to make modifications on .php files at all!

I only edited the files as instructed in the recomendation that I posted in post 1.!
have you checked direct login without using iframe [#] ?
(2020-04-08, 10:47 AM)Xalysis Wrote: [ -> ]
(2020-04-08, 09:52 AM)[ExiTuS] Wrote: [ -> ]As precaution drop (truncate) all sessions in table mybb_sessions.

This is what I mean with my 2nd comment :-)

I did this and now the I get a database error!!!!!
and do not get the index page!!!

In mySQL I found the table and in operations chose Truncate the whole table!
Was that what you meant, if not you did not explain what to do very well!

How can I recover from this?
Exactly!
Truncating mybb_sessions just deletes the temporary session details in this table. It cannot and will never cause any further error!
If the table mybb_sessions is still existing, then forget about this.

Your current database error is a new born issue.
Please check your database configuration in ./config.php -> username, password, database name, potential port etc.
If this is correct or was never changed, thencheck your login credentials on webserver/MySQL side.

First you need to get access to your database again.
When you get back to your forum pages, then go ahead with the login -> Look into your HTML source code whether the <input> "my_post_key" is really in place within <form>...</form>.

[ExiTuS]
Pages: 1 2