Solved: 2 Years, 10 Months ago login Authorization code mismatch. (fixed)
Solved: 2 Years, 10 Months 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.

(2018-07-05, 10:37 AM)kbilly Wrote:
(2018-07-05, 10:16 AM)Serpius Wrote:
(2018-07-05, 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.

<title>{$mybb->settings['bbname']} - {$lang->login}</title>
<br />
<form action="member.php" method="post">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<td class="thead" colspan="2"><strong>{$lang->login}</strong></td>
<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>
<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>
<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>
<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}" />

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:

Reverting the templates did not work for me.
I'm Serpius and You're Not    ¯\_(ツ)_/¯
Deaf Golf

Messages In This Thread
RE: login Authorization code mismatch. (fixed) - by Serpius - 2018-07-05, 10:41 AM

Forum Jump:

Users browsing this thread: 2 Guest(s)