MyBB Community Forums

Full Version: 3rd Party Login Authorisation Issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone, I've been working on adding new features to my community's website and one of those features is using your mybb account to login and access a page. 

My issue is that the system doesn't seem to even check the account details, and returns the following error on my main forums: 
Quote:Authorization code mismatch. Are you accessing this function correctly? Please go back and try again.

Website: 14aag.com 
Login Page (WIP): mods.14aag.com
Forums: forums.14aag.com

PHP Code: 
<?php
chdir('../forums');
define("IN_MYBB", 1);
require './global.php';
?>

                <?php
                if($mybb->user['uid'])
                {
                    // The user is logged in, say Hi
                    echo "Welcome, $mybbuser[username].<br>
                    You will now be taken to the mods section.";
                    }
                    else
                    {
                    // The user is not logged in, Display the form
                    echo "<div class='col s12 m12 l12'>
                        <h4>Login Form</h4>
                        </div><form action='http://14aag.com/forums/member.php' method='post'>
                        <input type='text' name='username' size='25' maxlength='30' placeholder='Username' class='login-field browser-default' /><br />
                        <input type='password' name='password' size='25' placeholder='Password' class='login-field browser-default' />
                        <input type='hidden' name='action' value='do_login'>
                        <input type='hidden' name='url' value='mods.php' /><br>
                        <center><button type='submit' class='submit' name='submit'><i class='fas fa-lock'></i> Login</button></center>
                    </form><br>";
                    }
                ?>

Any help on solving this is greatly appreciated, I'd very much like to sort this out!

Kind Regards,
Flinty
You may or may not find this applicable:

https://community.mybb.com/thread-218862.html
For those that might be interested, I had to add the follow line of code into my login form:

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

After
</div><form action='http://14aag.com/forums/member.php' method='post'>

Cheers for the help!
(2018-08-10, 02:08 PM)Flinty Wrote: [ -> ]For those that might be interested, I had to add the follow line of code into my login form:

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

After
</div><form action='http://14aag.com/forums/member.php' method='post'>

Cheers for the help!

Hmm... yea, that's the same thing that Ashley1 said when she posted that link.