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

GitHub.php: Invalid argument supplied for foreach() #68

Open
michaelharper opened this issue Jul 14, 2014 · 6 comments
Open

GitHub.php: Invalid argument supplied for foreach() #68

michaelharper opened this issue Jul 14, 2014 · 6 comments

Comments

@michaelharper
Copy link

screenshot 2014-07-14 17 43 26

Experiencing Invalid argument supplied for foreach() when I attempt to register with GitHub. Here is the function:

/**
 * Get the primary, verified email address from the Github data.
 *
 * @param  mixed $emails
 * @return mixed
 */
protected function getPrimaryEmail($emails)
{
    foreach ($emails as $email) {
        if (! $email->primary) {
            continue;
        }

        if ($email->verified) {
            return $email->email;
        }

        throw new GithubEmailNotVerifiedException;
    }

    return null;
}
@michaelharper
Copy link
Author

So after some digging it seems that $emails is returning null. Anyone have an idea? I'm relatively new to OAuth. Thanks.

@michaelharper
Copy link
Author

No one else is experiencing this issue....?

@w3z315
Copy link

w3z315 commented Aug 7, 2014

Hello there! I have reproduced this issue.
It seems like that the GitHub API is blocking requests from my Vagrant machine.
Do you use one too?

I noticed that if I open the requested API URL, I am receiving a correct response.

Unfortunately, I can not imagine any fixes for this issue. Any suggestions?

@michaelharper
Copy link
Author

No suggestions, it appears I might have to disable GitHub registration until I can figure out how to use their API. Mine is actually happening on production and not just from vagrant.

@marktopper
Copy link

@deeperDATA, I have the same issue, did you found a way around?

@michaelharper
Copy link
Author

@marktopper Nothing yet, I'm thinking about refactoring the Github integration completely. Love the framework but this is an important feature for my user demographic.

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

3 participants