Code Monkey home page Code Monkey logo

Comments (5)

olivervo avatar olivervo commented on May 29, 2024 1

Finally figured it out - $request->user() returns the user using the default guard defined in config/auth.php. In my case Nova is not using the default guard thus null was being returned.

To solve this specify the guard used by Nova: $request->user('guard-name').

from nova-settings-tool.

bakerkretzmar avatar bakerkretzmar commented on May 29, 2024

I can't reproduce this, are you absolutely sure the can() function that's returning null is that one, in that exact spot? What is the entire stack trace of the error you're getting?

from nova-settings-tool.

olivervo avatar olivervo commented on May 29, 2024

Here is the full stack trace: https://flareapp.io/share/x7Xk2vOP#F66

The error is occurring with no other nova packages/tools so I can't figure out what else it would be.

from nova-settings-tool.

bakerkretzmar avatar bakerkretzmar commented on May 29, 2024

Can you create a repo with a reproduction of that error? The code you shared in this issue works in a new app.

In that stack trace I can see that the error is happening at the /nova/settings URL but the canSee() and authorizedToSee() methods in the stack trace are part of Nova itself, I'm not overriding them.

Is your app doing anything that would change the behaviour of $request->user()? Is your Nova installation using any kind of custom auth stuff? What does your permissions.admin Gate actually look like?

from nova-settings-tool.

nikuscs avatar nikuscs commented on May 29, 2024

Indeed the gate is weird, can confirm $request->user() is null for canSee(), in my case im using different guards for the nova panel, so might be the issue.

from nova-settings-tool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.