Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom login script throws 500 #24

Open
senabean33 opened this issue May 8, 2017 · 0 comments
Open

Custom login script throws 500 #24

senabean33 opened this issue May 8, 2017 · 0 comments

Comments

@senabean33
Copy link

Hi our site uses a custom login function to assure that our members have signed a waiver, SSO works great from the main blon but when I call it from one of the subsites it throws a error my guess is because SSO is fired after wp_signon because even though it throws the error. closing the modal & refreshing the page shows that I am signed in. Any ideas on how I can fix this?

switch_to_blog(1);
$user = wp_signon( array( 'user_login' => $username, 'user_password' => $data['password'], 'remember' => $remember ), true );
restore_current_blog();

if ( is_wp_error( $user ) ) {
    $response['message'] = $user->get_error_message();
    wp_send_json( $response );
}
else {
    $response['success'] = true;....

img_3949
if you would like to see the problem in action let me know & I'll get you a login and URLS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant