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

auth guard getprovider returns null #17

Closed
rubanshah opened this issue Mar 27, 2018 · 1 comment
Closed

auth guard getprovider returns null #17

rubanshah opened this issue Mar 27, 2018 · 1 comment

Comments

@rubanshah
Copy link

i am getting following error

Call to a member function getModel() on null
Symfony\Component\Debug\Exception\FatalThrowableError
...\vendor\wildside\userstamps\src\Userstamps.php

and error is thrown from


protected function getUserClass()
    {
        if (get_class(auth()) === 'Illuminate\Auth\Guard') {
            return auth() -> getProvider() -> getModel();
        }
        return auth() -> guard() -> getProvider() -> getModel();
    }

but when i replace eht auth()->gurad()
to
auth()->guard('web') it works

protected function getUserClass()
    {
        if (get_class(auth()) === 'Illuminate\Auth\Guard') {
            return auth() -> getProvider() -> getModel();
        }
        return auth() -> guard('web') -> getProvider() -> getModel();
    }

i am using laravel 5.5 and passport api authentication

@mattmcdonald-uk
Copy link
Member

I can't reproduce this on a clean Laravel 5.5 install using Passport.

If you can provide a simplified reproducible example repository I'll re-open this and take a look.

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

2 participants