Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 1 Year, 3 Months, 1 Week ago login Authorization code mismatch. (fixed)
#1
Solved: 1 Year, 3 Months, 1 Week ago
Updated to MyBB 1.8.16 and now trying to login in shows this message

login Authorization code mismatch. Are you accessing this function correctly? Please go back and try again.

Seems to be affecting all custom themes from what I can see, as the default theme logs in no issues.

Going to try to see what's what but will be hard.

I compared member_login template code

It's this line here doing it.
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />

It needs to be added directly under this line:
<input type="hidden" name="url" value="{$redirect_url}" />

Please change your member_login code to this now.
Or just copy the default templates member_ login code to your custom theme.

<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->login}</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
{$inline_errors}
{$member_loggedin_notice}
<form action="member.php" method="post">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->login}</strong></td>
</tr>
<tr>
						   
					   
	 
	
<td class="trow1"><strong>{$lang->username}</strong></td>
<td class="trow1"><input type="text" class="textbox" name="username" size="25" style="width: 200px;" value="{$username}" /></td>
</tr>
<tr>
<td class="trow2"><strong>{$lang->password}</strong><br /><span class="smalltext">{$lang->pw_note}</span></td>
<td class="trow2"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" value="{$password}" /> (<a href="member.php?action=lostpw">{$lang->lostpw_note}</a>)</td>
</tr>
<tr>
<td class="trow1" colspan="2" align="center"><label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" checked="checked" value="yes" /> {$lang->remember_me}</label></td>
	 
	
						   
					   
</tr>
{$captcha}
</table>
<br />
<div align="center"><input type="submit" class="button" name="submit" value="{$lang->login}" /></div>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />
</form>
{$footer}
</body>
</html>

This also breaks the login on "portal_welcome_guesttext" and isn't fixed even when using the MyBB default template.

Update your "portal_welcome_guesttext" code to this

<span class="smalltext">{$lang->guest_welcome_registration}</span><br />
<br />
<form method="post" action="{$mybb->settings['bburl']}/member.php"><input type="hidden" name="action" value="do_login" /><input type="hidden" name="url" value="{$portal_url}" />
{$username}<br />&nbsp;&nbsp;<input type="text" class="textbox" name="username" value="" /><br /><br />
{$lang->password}<br />&nbsp;&nbsp;<input type="password" class="textbox" name="password" value="" /><br /><br />
<label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" value="yes" /> {$lang->remember_me}</label><br /><br />
<br /><input type="submit" class="button" name="loginsubmit" value="{$lang->login}" /><input name="my_post_key" type="hidden" value="{$mybb->post_code}" /></form>
#2
Solved: 1 Year, 3 Months, 1 Week ago
(07-05-2018, 04:42 AM)drguild Wrote: Updated to MyBB 1.8.16 and now trying to login in shows this message

login Authorization code mismatch. Are you accessing this function correctly? Please go back and try again.

Seems to be affecting all custom themes from what I can see, as the default theme logs in no issues.

Going to try to see what's what but will be hard.

I compared member_login template code

It's this line here doing it.
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />

It needs to be added directly under this line:
<input type="hidden" name="url" value="{$redirect_url}" />

Please change your member_login code to this now.
Or just copy the default templates member_ login code to your custom theme.

<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->login}</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
{$inline_errors}
{$member_loggedin_notice}
<form action="member.php" method="post">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->login}</strong></td>
</tr>
<tr>
						   
					   
	 
	
<td class="trow1"><strong>{$lang->username}</strong></td>
<td class="trow1"><input type="text" class="textbox" name="username" size="25" style="width: 200px;" value="{$username}" /></td>
</tr>
<tr>
<td class="trow2"><strong>{$lang->password}</strong><br /><span class="smalltext">{$lang->pw_note}</span></td>
<td class="trow2"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" value="{$password}" /> (<a href="member.php?action=lostpw">{$lang->lostpw_note}</a>)</td>
</tr>
<tr>
<td class="trow1" colspan="2" align="center"><label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" checked="checked" value="yes" /> {$lang->remember_me}</label></td>
	 
	
						   
					   
</tr>
{$captcha}
</table>
<br />
<div align="center"><input type="submit" class="button" name="submit" value="{$lang->login}" /></div>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />
</form>
{$footer}
</body>
</html>

This also breaks the login on "portal_welcome_guesttext" and isn't fixed even when using the MyBB default template.

Update your "portal_welcome_guesttext" code to this

<span class="smalltext">{$lang->guest_welcome_registration}</span><br />
<br />
<form method="post" action="{$mybb->settings['bburl']}/member.php"><input type="hidden" name="action" value="do_login" /><input type="hidden" name="url" value="{$portal_url}" />
{$username}<br />&nbsp;&nbsp;<input type="text" class="textbox" name="username" value="" /><br /><br />
{$lang->password}<br />&nbsp;&nbsp;<input type="password" class="textbox" name="password" value="" /><br /><br />
<label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" value="yes" /> {$lang->remember_me}</label><br /><br />
<br /><input type="submit" class="button" name="loginsubmit" value="{$lang->login}" /><input name="my_post_key" type="hidden" value="{$mybb->post_code}" /></form>

It's not working for my website.

I'm using the custom theme and already have implemented the suggested fixes to the templates and I can't even log into my own account.

I can log into the AdminCP with no problems, though.
I'm Serpius and You're Not    ¯\_(ツ)_/¯
[Image: y3xr3cj5]
#3
Solved: 1 Year, 3 Months, 1 Week ago
(07-05-2018, 10:16 AM)Serpius Wrote:
(07-05-2018, 04:42 AM)drguild Wrote: Updated to MyBB 1.8.16 and now trying to login in shows this message

login Authorization code mismatch. Are you accessing this function correctly? Please go back and try again.

Seems to be affecting all custom themes from what I can see, as the default theme logs in no issues.

Going to try to see what's what but will be hard.

I compared member_login template code

It's this line here doing it.
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />

It needs to be added directly under this line:
<input type="hidden" name="url" value="{$redirect_url}" />

Please change your member_login code to this now.
Or just copy the default templates member_ login code to your custom theme.

<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->login}</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
{$inline_errors}
{$member_loggedin_notice}
<form action="member.php" method="post">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->login}</strong></td>
</tr>
<tr>
						   
					   
	 
	
<td class="trow1"><strong>{$lang->username}</strong></td>
<td class="trow1"><input type="text" class="textbox" name="username" size="25" style="width: 200px;" value="{$username}" /></td>
</tr>
<tr>
<td class="trow2"><strong>{$lang->password}</strong><br /><span class="smalltext">{$lang->pw_note}</span></td>
<td class="trow2"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" value="{$password}" /> (<a href="member.php?action=lostpw">{$lang->lostpw_note}</a>)</td>
</tr>
<tr>
<td class="trow1" colspan="2" align="center"><label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" checked="checked" value="yes" /> {$lang->remember_me}</label></td>
	 
	
						   
					   
</tr>
{$captcha}
</table>
<br />
<div align="center"><input type="submit" class="button" name="submit" value="{$lang->login}" /></div>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />
</form>
{$footer}
</body>
</html>

This also breaks the login on "portal_welcome_guesttext" and isn't fixed even when using the MyBB default template.

Update your "portal_welcome_guesttext" code to this

<span class="smalltext">{$lang->guest_welcome_registration}</span><br />
<br />
<form method="post" action="{$mybb->settings['bburl']}/member.php"><input type="hidden" name="action" value="do_login" /><input type="hidden" name="url" value="{$portal_url}" />
{$username}<br />&nbsp;&nbsp;<input type="text" class="textbox" name="username" value="" /><br /><br />
{$lang->password}<br />&nbsp;&nbsp;<input type="password" class="textbox" name="password" value="" /><br /><br />
<label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" value="yes" /> {$lang->remember_me}</label><br /><br />
<br /><input type="submit" class="button" name="loginsubmit" value="{$lang->login}" /><input name="my_post_key" type="hidden" value="{$mybb->post_code}" /></form>

It's not working for my website.

I'm using the custom theme and already have implemented the suggested fixes to the templates and I can't even log into my own account.

I can log into the AdminCP with no problems, though.
Try this bro:

https://community.mybb.com/thread-218430.html
#4
Solved: 1 Year, 3 Months, 1 Week ago
Depending on which theme you're using, there could be multiple login entry points.

* error_nopermission
* header_welcomeblock_guest
* member_login
* portal_welcome_guesttext

Add the new input tag in and should be good to go.

Easiest way is to export your current custom template out to a XML and do a search for do_login to find the templates.
#5
Solved: 1 Year, 3 Months, 1 Week ago
WTF, MyBB!! Angry

Fix this ASAP!!

I can't even log onto my own website. However, I can still log onto the AdminCP.

Why wasn't this error caught before the release of 1.8.16?? Huh

Wasn't there enough testing done to assure everything was working properly?

EDIT: After 45 minutes... finally, I am able to log onto my website! It was only AFTER I applied to the fix to ALL of the themes on my website. Not just the one main theme that everyone uses. It's weird that everything worked AFTER I fixed all 3 themes.

Thanks to @drguild for providing a fix for this error.

(07-05-2018, 10:37 AM)kbilly Wrote:
(07-05-2018, 10:16 AM)Serpius Wrote:
(07-05-2018, 04:42 AM)drguild Wrote: Updated to MyBB 1.8.16 and now trying to login in shows this message

login Authorization code mismatch. Are you accessing this function correctly? Please go back and try again.

Seems to be affecting all custom themes from what I can see, as the default theme logs in no issues.

Going to try to see what's what but will be hard.

I compared member_login template code

It's this line here doing it.
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />

It needs to be added directly under this line:
<input type="hidden" name="url" value="{$redirect_url}" />

Please change your member_login code to this now.
Or just copy the default templates member_ login code to your custom theme.

<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->login}</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
{$inline_errors}
{$member_loggedin_notice}
<form action="member.php" method="post">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->login}</strong></td>
</tr>
<tr>
						   
					   
	 
	
<td class="trow1"><strong>{$lang->username}</strong></td>
<td class="trow1"><input type="text" class="textbox" name="username" size="25" style="width: 200px;" value="{$username}" /></td>
</tr>
<tr>
<td class="trow2"><strong>{$lang->password}</strong><br /><span class="smalltext">{$lang->pw_note}</span></td>
<td class="trow2"><input type="password" class="textbox" name="password" size="25" style="width: 200px;" value="{$password}" /> (<a href="member.php?action=lostpw">{$lang->lostpw_note}</a>)</td>
</tr>
<tr>
<td class="trow1" colspan="2" align="center"><label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" checked="checked" value="yes" /> {$lang->remember_me}</label></td>
	 
	
						   
					   
</tr>
{$captcha}
</table>
<br />
<div align="center"><input type="submit" class="button" name="submit" value="{$lang->login}" /></div>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />
</form>
{$footer}
</body>
</html>

This also breaks the login on "portal_welcome_guesttext" and isn't fixed even when using the MyBB default template.

Update your "portal_welcome_guesttext" code to this

<span class="smalltext">{$lang->guest_welcome_registration}</span><br />
<br />
<form method="post" action="{$mybb->settings['bburl']}/member.php"><input type="hidden" name="action" value="do_login" /><input type="hidden" name="url" value="{$portal_url}" />
{$username}<br />&nbsp;&nbsp;<input type="text" class="textbox" name="username" value="" /><br /><br />
{$lang->password}<br />&nbsp;&nbsp;<input type="password" class="textbox" name="password" value="" /><br /><br />
<label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" value="yes" /> {$lang->remember_me}</label><br /><br />
<br /><input type="submit" class="button" name="loginsubmit" value="{$lang->login}" /><input name="my_post_key" type="hidden" value="{$mybb->post_code}" /></form>

It's not working for my website.

I'm using the custom theme and already have implemented the suggested fixes to the templates and I can't even log into my own account.

I can log into the AdminCP with no problems, though.
Try this bro:

https://community.mybb.com/thread-218430.html

Reverting the templates did not work for me.
I'm Serpius and You're Not    ¯\_(ツ)_/¯
[Image: y3xr3cj5]
#6
Solved: 1 Year, 3 Months, 1 Week ago
Yes there are multiple entry points.

Also its NOT something MyBB should revert as it appears to have been done as a security measure by parsing along a hidden code with the login to avoid login spoofing.

However MyBB should have picked it up with custom themes and added a message in blog the announcement of 1.8.16 about it and the change required.
Also they didn't this pick this up on there portal login which I noticed as above.

One should ALWAYS read the change notes as important changes should be listed which I do,
However it is crucial that any QA pick up custom theme etc core breaking changes and they should be listed as well as what is required in a upgrade.

As there have a few bugs passed through, youtube, moderation logs and now a change to a secure login on themes portal was missed.
I think more QA and polish is needed, mby also an staggered release cycle, with staff / acknowledged developers (themes/plugins/etc) getting the changes first before its released to everyone.

Would help save any more issues especially with 1.9 being a massive change.
#7
Solved: 1 Year, 3 Months, 1 Week ago
I don’t believe this required a notification for developers as it instructs you about template changes here. We can lead you to the page but we cannot force you to read information. If you read point 3 in “Beginning the Upgrade” you wouldn’t of had such an issue. I will look back over the portal page when upgrading and see what adjustments are needed.

Thanks for the report.
Plugin Count: I lost count.
Public Plugins are available here.
Official GitHub.
Please do not PM me for support unless asked to.
#8
Solved: 1 Year, 3 Months, 1 Week ago
(07-05-2018, 10:54 AM)drguild Wrote: Yes there are multiple entry points.

Also its NOT something MyBB should revert as it appears to have been done as a security measure by parsing along a hidden code with the login to avoid login spoofing.

However MyBB should have picked it up with custom themes and added a message in blog the announcement of 1.8.16 about it and the change required.
Also they didn't this pick this up on there portal login which I noticed as above.

One should ALWAYS read the change notes as important changes should be listed which I do,
However it is crucial that any QA pick up custom theme etc core breaking changes and they should be listed as well as what is required in a upgrade.

As there have a few bugs passed through, youtube, moderation logs and now a change to a secure login on themes portal was missed.
I think more QA and polish is needed, mby also an staggered release cycle, with staff / acknowledged developers (themes/plugins/etc) getting the changes first before its released to everyone.

Would help save any more issues especially with 1.9 being a massive change.

You said it better than I did!

Just to follow-up on this 'Mismatch' issue...

I was INCORRECT to assume that when I changed all of the codes in those themes that my website uses, the problem was solved. NOPE!

Here's what happened... I had switched to one of the themes that more or less used the original default MyBB theme, except this was the dark version of it. This Theme

I logged in just fine using that theme, then I used the theme selection thingy at the bottom of the main page, and lo and behold, I am able to use my custom theme!

Yes, I did read up on the changes in the CSS, but I am NOT a coder and I am not very well versed in CSS.

So, in seeing all of what is going on in the past few hours... it's obvious that the MyBB developers missed the boat completely in explaining EXACTLY what needs to be done to prevent this major error.

Could we be seeing a 1.8.17 coming out real soon to fix this error?

If so... MyBB developers better hurry up because the more admins make the upgrade to 1.8.16, the worst the issue will become.
I'm Serpius and You're Not    ¯\_(ツ)_/¯
[Image: y3xr3cj5]
#9
Solved: 1 Year, 3 Months, 1 Week ago
Serpius, CSS couldn’t of possibly of caused the mismatch error. Unless this occurs in a plugin it’s 99% of the time an issue with a template. As said before, following my guidance above would solve this error.
Plugin Count: I lost count.
Public Plugins are available here.
Official GitHub.
Please do not PM me for support unless asked to.
#10
Solved: 1 Year, 3 Months, 1 Week ago
(07-05-2018, 11:05 AM)Wires Wrote: I don’t believe this required a notification for developers as it instructs you about template changes here. We can lead you to the page but we cannot force you to read information. If you read point 3 in “Beginning the Upgrade” you wouldn’t of had such an issue. I will look back over the portal page when upgrading and see what adjustments are needed.

Thanks for the report.

@Wires

Sorry, but I did read all of that and I was still unable to log onto my website.

See, the problem is that I am NOT a coder, nor do I understand CSS.

So, that presents a major problem for me when I tried to look at the Diff Report... I'm looking at the code, but I have ZERO clue on what to do to fix the code to make the error go away. 

You're basing your assumption that all Admins are coders, which is not true.

Back to my point... this is a major screwup that MyBB developers need to fix ASAP. (you'll probably disagree, but I think I speak for many)
I'm Serpius and You're Not    ¯\_(ツ)_/¯
[Image: y3xr3cj5]


Forum Jump:


Users browsing this thread: 1 Guest(s)