-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add shared-data for things like auth #1
Comments
@zimt28 Any suggestions on how to implement this? |
The only sane way I see to get something similar is a function that adds a key/value pair to |
That makes sense, the developer will just create a custom plug. It's not much different from the way the official rails adapter handles it. Gonna try to stick to their naming of things for consistency. |
conn.private should be used for this I believe?: This storage is meant to be used by libraries and frameworks to avoid writing to the user storage (the :assigns field). It is recommended for libraries/frameworks to prefix the keys with the library name.: |
Thanks @bigx333. Good thinking. Let me know if anyone wants to stab at this. |
@bigx333 Yes, much better! Totally forgot about it :) |
@tmartin314 On it, will send a PR tomorrow |
@zimt28 great! I'll jump on something else |
The Laravel implementation uses strings as keys and even allows nesting, eg I'd prefer atom keys over binary, but we cannot support nesting like Laravel then, which I don't see as an issue. What's your opinion on this, should we support atoms, binaries or both? |
I think we may need to support both as some data might be dynamically generated, but atoms are preferable for sure. |
@tmartin314 Sorry for the missing PR, different time zone and I went to bed first 😄 Thanks for merging the code! |
Add shared data that will be loaded on every request for auth and other data.
https://inertiajs.com/shared-data
The text was updated successfully, but these errors were encountered: