-
Notifications
You must be signed in to change notification settings - Fork 590
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
Authorization not working, backpack #360
Comments
This is unrelated to the |
default authorization not working too |
In that case you can file a separate issue with the code and expected result |
What is the issue here? |
I authorized other user but laravel telescope show anyway |
The default /**
* Configure the Telescope authorization services.
*
* @return void
*/
protected function authorization()
{
$this->gate();
Telescope::auth(function ($request) {
return app()->environment('local') ||
Gate::check('viewTelescope', [$request->user()]);
});
} You need to override this method in your /**
* Configure the Telescope authorization services.
*
* @return void
*/
protected function authorization()
{
$this->gate();
Telescope::auth(function ($request) {
return Gate::check('viewTelescope', [$request->user()]);
});
} |
$request->user() is null, and why ? |
Refer #294 (comment) and #294 (comment) |
$request->user('my_guard_name') But it's still the same null |
Can't replicate this, authentication with custom guard is working. and |
null returns (( |
closing since it doesn't seem to be Telescope related. |
$request->user() is null |
I use laravel backpack and override Telescope Authorize Middleware class, As shown on the photo. But backpack_auth()->guest(); always true, but I have already logged in.
I use backpack guard.
The text was updated successfully, but these errors were encountered: