MyBB Community Forums

Full Version: Login doesn't work after changing servers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is a really irritating issue and I can't find the fix for it anywhere. I switched hosts and used a full home directory backup, and the backup of the SQL database from MyBB admin panel, there was a couple of errors which I fixed (some problems with the plugins which was fixed after reinstalling), but now I'm getting a login problem when users try to login. I'm on the latest MyBB version.

It comes up with:
'Authorization code mismatch. Are you accessing this function correctly? Please go back and try again.'
This has already been fixed previously by me which I added some code to certain templates, which is all still there but it is still coming with the same error after trying to login. It comes up with the same error if you login on the default template.

Anyone have ideas? Adding this below didn't fix it (it was already on the template I'm using as I had the error previously)
<input name="my_post_key" type="hidden" value="{$mybb->post_code}" />
which browser you are using ? have you tried using a different browser ?
do you have any cache setup [eg. cloudflare ..]

you may try using this method to fix the issue
Temp fix by changing direction of Login button from the Login box which is prompt to '/member.php?action=login' which takes you directly to the login page.

(2019-05-09, 05:07 AM).m. Wrote: [ -> ]which browser you are using ? have you tried using a different browser ?
do you have any cache setup [eg. cloudflare ..]

you may try using this method to fix the issue

I'm using Chrome, also tried in Incognito, and had it reported about the issue. Still no fix apart from my temp fix but I would like the login prompt to work also.
(2019-05-09, 05:10 AM)Fours4 Wrote: [ -> ]Temp fix by changing direction of Login button from the Login box which is prompt to '/member.php?action=login' which takes you directly to the login page.

(2019-05-09, 05:07 AM).m. Wrote: [ -> ]which browser you are using ? have you tried using a different browser ?
do you have any cache setup [eg. cloudflare ..]

you may try using this method to fix the issue

I'm using Chrome, also tried in Incognito, and had it reported about the issue. Still no fix apart from my temp fix but I would like the login prompt to work also.

try this login form:

<div id="quick_login;">
 <form action="member.php" method="post">
               <input type="hidden" name="action" value="do_login" />
               <input type="hidden" name="url" value="{$redirect_url}" />
 <table border="0" align="center" cellspacing="0" cellpadding="5" style="width:50%;text-align:left;box-shadow:none;background: #c3b49d;border: 1px solid #1f3756;">
 <thead>
 <tr>
 <td class="thead" align="center" style="padding:10px;height:43px;">
 <span style="font-size: 40px;text-align:center;">Login</span>
 </td> 
 </tr> 
 </thead>
 <tbody>
 <tr>
    <td style="padding: 20px 20px 27px 20px;">
 <span class="smalltext"><i class="fa fa-user">&nbsp;</i><label for="username">Username:</label></span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Username" name="quick_username" id="quick_login_username" type="text" value="" class="textbox-zx" /></span>
 <br />
 <br />
 <i class="fa fa-key">&nbsp;</i><span class="smalltext">Password:</span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Password" name="quick_password" id="password-field" type="password" value="" class="textbox-zx" /><span style="color: #000; margin-left: -24px;" toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password"></span></span>
 
 <br /> 
 <div align="center">
 <div align="center;" style="padding:10px;"><input style="font-size: 14px;display: inline-block;margin: 10px 0px 6px;padding: 9px 99px 9px 99px;" name="submit" type="submit" class="button-l" value="LOGIN" tabindex="3" /> </div>
 <input name="quick_remember" id="quick_login_remember" type="checkbox" value="yes" class="checkbox" checked="checked" />
 <label for="quick_login_remember"><i> {$lang->remember_me}</i> </label>
 <br />
 <div styuyle="padding:5px;"><a href="{$mybb->settings['bburl']}/member.php?action=lostpw" class="buttonno lost_password">{$lang->lost_password}</a></div>
 
                                    </div>
 </td>
 </tr>
 </table>
 </form>
 </div>
 <script type="text/javascript">
 $("#quick_login input[name='url']").val($(location).attr('href'));
 $(".toggle-password").click(function() {

  $(this).toggleClass("fa-eye fa-eye-slash");
  var input = $($(this).attr("toggle"));
  if (input.attr("type") == "password") {
    input.attr("type", "text");
  } else {
    input.attr("type", "password");
  }
});
 </script>

This is just the form structure, you will need to add your own css, but the form itself should fix your issue.
(2019-05-09, 05:25 AM)Michael2014 Wrote: [ -> ]
(2019-05-09, 05:10 AM)Fours4 Wrote: [ -> ]Temp fix by changing direction of Login button from the Login box which is prompt to '/member.php?action=login' which takes you directly to the login page.

(2019-05-09, 05:07 AM).m. Wrote: [ -> ]which browser you are using ? have you tried using a different browser ?
do you have any cache setup [eg. cloudflare ..]

you may try using this method to fix the issue

I'm using Chrome, also tried in Incognito, and had it reported about the issue. Still no fix apart from my temp fix but I would like the login prompt to work also.

try this login form:

<div id="quick_login;">
 <form action="member.php" method="post">
               <input type="hidden" name="action" value="do_login" />
               <input type="hidden" name="url" value="{$redirect_url}" />
 <table border="0" align="center" cellspacing="0" cellpadding="5" style="width:50%;text-align:left;box-shadow:none;background: #c3b49d;border: 1px solid #1f3756;">
 <thead>
 <tr>
 <td class="thead" align="center" style="padding:10px;height:43px;">
 <span style="font-size: 40px;text-align:center;">Login</span>
 </td> 
 </tr> 
 </thead>
 <tbody>
 <tr>
    <td style="padding: 20px 20px 27px 20px;">
 <span class="smalltext"><i class="fa fa-user">&nbsp;</i><label for="username">Username:</label></span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Username" name="quick_username" id="quick_login_username" type="text" value="" class="textbox-zx" /></span>
 <br />
 <br />
 <i class="fa fa-key">&nbsp;</i><span class="smalltext">Password:</span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Password" name="quick_password" id="password-field" type="password" value="" class="textbox-zx" /><span style="color: #000; margin-left: -24px;" toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password"></span></span>
 
 <br /> 
 <div align="center">
 <div align="center;" style="padding:10px;"><input style="font-size: 14px;display: inline-block;margin: 10px 0px 6px;padding: 9px 99px 9px 99px;" name="submit" type="submit" class="button-l" value="LOGIN" tabindex="3" /> </div>
 <input name="quick_remember" id="quick_login_remember" type="checkbox" value="yes" class="checkbox" checked="checked" />
 <label for="quick_login_remember"><i> {$lang->remember_me}</i> </label>
 <br />
 <div styuyle="padding:5px;"><a href="{$mybb->settings['bburl']}/member.php?action=lostpw" class="buttonno lost_password">{$lang->lost_password}</a></div>
 
                                    </div>
 </td>
 </tr>
 </table>
 </form>
 </div>
 <script type="text/javascript">
 $("#quick_login input[name='url']").val($(location).attr('href'));
 $(".toggle-password").click(function() {

  $(this).toggleClass("fa-eye fa-eye-slash");
  var input = $($(this).attr("toggle"));
  if (input.attr("type") == "password") {
    input.attr("type", "text");
  } else {
    input.attr("type", "password");
  }
});
 </script>

This is just the form structure, you will need to add your own css, but the form itself should fix your issue.
What template should I add this to?
(2019-05-09, 05:33 AM)Fours4 Wrote: [ -> ]
(2019-05-09, 05:25 AM)Michael2014 Wrote: [ -> ]
(2019-05-09, 05:10 AM)Fours4 Wrote: [ -> ]Temp fix by changing direction of Login button from the Login box which is prompt to '/member.php?action=login' which takes you directly to the login page.

(2019-05-09, 05:07 AM).m. Wrote: [ -> ]which browser you are using ? have you tried using a different browser ?
do you have any cache setup [eg. cloudflare ..]

you may try using this method to fix the issue

I'm using Chrome, also tried in Incognito, and had it reported about the issue. Still no fix apart from my temp fix but I would like the login prompt to work also.

try this login form:

<div id="quick_login;">
 <form action="member.php" method="post">
               <input type="hidden" name="action" value="do_login" />
               <input type="hidden" name="url" value="{$redirect_url}" />
 <table border="0" align="center" cellspacing="0" cellpadding="5" style="width:50%;text-align:left;box-shadow:none;background: #c3b49d;border: 1px solid #1f3756;">
 <thead>
 <tr>
 <td class="thead" align="center" style="padding:10px;height:43px;">
 <span style="font-size: 40px;text-align:center;">Login</span>
 </td> 
 </tr> 
 </thead>
 <tbody>
 <tr>
    <td style="padding: 20px 20px 27px 20px;">
 <span class="smalltext"><i class="fa fa-user">&nbsp;</i><label for="username">Username:</label></span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Username" name="quick_username" id="quick_login_username" type="text" value="" class="textbox-zx" /></span>
 <br />
 <br />
 <i class="fa fa-key">&nbsp;</i><span class="smalltext">Password:</span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Password" name="quick_password" id="password-field" type="password" value="" class="textbox-zx" /><span style="color: #000; margin-left: -24px;" toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password"></span></span>
 
 <br /> 
 <div align="center">
 <div align="center;" style="padding:10px;"><input style="font-size: 14px;display: inline-block;margin: 10px 0px 6px;padding: 9px 99px 9px 99px;" name="submit" type="submit" class="button-l" value="LOGIN" tabindex="3" /> </div>
 <input name="quick_remember" id="quick_login_remember" type="checkbox" value="yes" class="checkbox" checked="checked" />
 <label for="quick_login_remember"><i> {$lang->remember_me}</i> </label>
 <br />
 <div styuyle="padding:5px;"><a href="{$mybb->settings['bburl']}/member.php?action=lostpw" class="buttonno lost_password">{$lang->lost_password}</a></div>
 
                                    </div>
 </td>
 </tr>
 </table>
 </form>
 </div>
 <script type="text/javascript">
 $("#quick_login input[name='url']").val($(location).attr('href'));
 $(".toggle-password").click(function() {

  $(this).toggleClass("fa-eye fa-eye-slash");
  var input = $($(this).attr("toggle"));
  if (input.attr("type") == "password") {
    input.attr("type", "text");
  } else {
    input.attr("type", "password");
  }
});
 </script>

This is just the form structure, you will need to add your own css, but the form itself should fix your issue.
What template should I add this to?

the template is member_login, you can also try reverting template member_login but I'm sure the form will work as well.
(2019-05-09, 05:35 AM)Michael2014 Wrote: [ -> ]
(2019-05-09, 05:33 AM)Fours4 Wrote: [ -> ]
(2019-05-09, 05:25 AM)Michael2014 Wrote: [ -> ]
(2019-05-09, 05:10 AM)Fours4 Wrote: [ -> ]Temp fix by changing direction of Login button from the Login box which is prompt to '/member.php?action=login' which takes you directly to the login page.

(2019-05-09, 05:07 AM).m. Wrote: [ -> ]which browser you are using ? have you tried using a different browser ?
do you have any cache setup [eg. cloudflare ..]

you may try using this method to fix the issue

I'm using Chrome, also tried in Incognito, and had it reported about the issue. Still no fix apart from my temp fix but I would like the login prompt to work also.

try this login form:

<div id="quick_login;">
 <form action="member.php" method="post">
               <input type="hidden" name="action" value="do_login" />
               <input type="hidden" name="url" value="{$redirect_url}" />
 <table border="0" align="center" cellspacing="0" cellpadding="5" style="width:50%;text-align:left;box-shadow:none;background: #c3b49d;border: 1px solid #1f3756;">
 <thead>
 <tr>
 <td class="thead" align="center" style="padding:10px;height:43px;">
 <span style="font-size: 40px;text-align:center;">Login</span>
 </td> 
 </tr> 
 </thead>
 <tbody>
 <tr>
    <td style="padding: 20px 20px 27px 20px;">
 <span class="smalltext"><i class="fa fa-user">&nbsp;</i><label for="username">Username:</label></span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Username" name="quick_username" id="quick_login_username" type="text" value="" class="textbox-zx" /></span>
 <br />
 <br />
 <i class="fa fa-key">&nbsp;</i><span class="smalltext">Password:</span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Password" name="quick_password" id="password-field" type="password" value="" class="textbox-zx" /><span style="color: #000; margin-left: -24px;" toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password"></span></span>
 
 <br /> 
 <div align="center">
 <div align="center;" style="padding:10px;"><input style="font-size: 14px;display: inline-block;margin: 10px 0px 6px;padding: 9px 99px 9px 99px;" name="submit" type="submit" class="button-l" value="LOGIN" tabindex="3" /> </div>
 <input name="quick_remember" id="quick_login_remember" type="checkbox" value="yes" class="checkbox" checked="checked" />
 <label for="quick_login_remember"><i> {$lang->remember_me}</i> </label>
 <br />
 <div styuyle="padding:5px;"><a href="{$mybb->settings['bburl']}/member.php?action=lostpw" class="buttonno lost_password">{$lang->lost_password}</a></div>
 
                                    </div>
 </td>
 </tr>
 </table>
 </form>
 </div>
 <script type="text/javascript">
 $("#quick_login input[name='url']").val($(location).attr('href'));
 $(".toggle-password").click(function() {

  $(this).toggleClass("fa-eye fa-eye-slash");
  var input = $($(this).attr("toggle"));
  if (input.attr("type") == "password") {
    input.attr("type", "text");
  } else {
    input.attr("type", "password");
  }
});
 </script>

This is just the form structure, you will need to add your own css, but the form itself should fix your issue.
What template should I add this to?

the template is member_login, you can also try reverting template member_login but I'm sure the form will work as well.
Thanks, thought it was for a different template as mine looked completely different. I've updated with that and it seems to work, but doesn't work on mobile or on incognito mode, comes up with same authorization error, do you know how I can fix that?
(2019-05-10, 05:54 AM)Fours4 Wrote: [ -> ]
(2019-05-09, 05:35 AM)Michael2014 Wrote: [ -> ]
(2019-05-09, 05:33 AM)Fours4 Wrote: [ -> ]
(2019-05-09, 05:25 AM)Michael2014 Wrote: [ -> ]
(2019-05-09, 05:10 AM)Fours4 Wrote: [ -> ]Temp fix by changing direction of Login button from the Login box which is prompt to '/member.php?action=login' which takes you directly to the login page.


I'm using Chrome, also tried in Incognito, and had it reported about the issue. Still no fix apart from my temp fix but I would like the login prompt to work also.

try this login form:

<div id="quick_login;">
 <form action="member.php" method="post">
               <input type="hidden" name="action" value="do_login" />
               <input type="hidden" name="url" value="{$redirect_url}" />
 <table border="0" align="center" cellspacing="0" cellpadding="5" style="width:50%;text-align:left;box-shadow:none;background: #c3b49d;border: 1px solid #1f3756;">
 <thead>
 <tr>
 <td class="thead" align="center" style="padding:10px;height:43px;">
 <span style="font-size: 40px;text-align:center;">Login</span>
 </td> 
 </tr> 
 </thead>
 <tbody>
 <tr>
    <td style="padding: 20px 20px 27px 20px;">
 <span class="smalltext"><i class="fa fa-user">&nbsp;</i><label for="username">Username:</label></span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Username" name="quick_username" id="quick_login_username" type="text" value="" class="textbox-zx" /></span>
 <br />
 <br />
 <i class="fa fa-key">&nbsp;</i><span class="smalltext">Password:</span><div style="padding-bottom: 5px;"></div>
 
 <span class="field"><input style="margin-left: -1px; padding: 4px  10px;" width="100%" placeholder="Password" name="quick_password" id="password-field" type="password" value="" class="textbox-zx" /><span style="color: #000; margin-left: -24px;" toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password"></span></span>
 
 <br /> 
 <div align="center">
 <div align="center;" style="padding:10px;"><input style="font-size: 14px;display: inline-block;margin: 10px 0px 6px;padding: 9px 99px 9px 99px;" name="submit" type="submit" class="button-l" value="LOGIN" tabindex="3" /> </div>
 <input name="quick_remember" id="quick_login_remember" type="checkbox" value="yes" class="checkbox" checked="checked" />
 <label for="quick_login_remember"><i> {$lang->remember_me}</i> </label>
 <br />
 <div styuyle="padding:5px;"><a href="{$mybb->settings['bburl']}/member.php?action=lostpw" class="buttonno lost_password">{$lang->lost_password}</a></div>
 
                                    </div>
 </td>
 </tr>
 </table>
 </form>
 </div>
 <script type="text/javascript">
 $("#quick_login input[name='url']").val($(location).attr('href'));
 $(".toggle-password").click(function() {

  $(this).toggleClass("fa-eye fa-eye-slash");
  var input = $($(this).attr("toggle"));
  if (input.attr("type") == "password") {
    input.attr("type", "text");
  } else {
    input.attr("type", "password");
  }
});
 </script>

This is just the form structure, you will need to add your own css, but the form itself should fix your issue.
What template should I add this to?

the template is member_login, you can also try reverting template member_login but I'm sure the form will work as well.
Thanks, thought it was for a different template as mine looked completely different. I've updated with that and it seems to work, but doesn't work on mobile or on incognito mode, comes up with same authorization error, do you know how I can fix that?

First, try clearing your mobile cache completely. Let me know if that works.