Solved: 4 Years, 1 Month, 1 Week ago login Authorization code mismatch. (fixed)
Solved: 4 Years, 1 Month, 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.

<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>

Messages In This Thread
login Authorization code mismatch. (fixed) - by drguild - 2018-07-05, 04:42 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)