You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project that uses Elixir, Phoenix, and Ash and I want to integrate Beacon as my CMS to enable content editing for certain pages on the deployed app without having to worry about rebuilding and redeploying.
For this to work, I need a way to be able to get access to the assigns variable for the session (and possibly the page as well, but that is less important for now). This is so that I can see things like the currently logged in user (via ash_authentication) and have access to other Ash features, too.
At the moment, there is an issue when specifying routes that are handled by beacon_site as they do not work if there are any extra params to the scope command in router.ex.
Which I guess is because beacon_site is not defined for the MscmsWeb scope. But I would be the first to admit that I really have no idea, as I'm just guessing ... :)
In the above example, I need to run those beacon_site calls thru the scope with the MscmsWeb parameters as that is where all of the Ash goodies are invoked. For example, if I wanted to ensure that some parts of the Beacon pages are only accessible to a logged in user, I'd need to run them through that scope, and then on some of the Beacon pages I'd need to be able to inspect the session for :current_user in assigns.
Ash and Beacon are both great pieces of software so it would be excellent if I was able to use them together.
Context
I am working on a project that uses Elixir, Phoenix, and Ash and I want to integrate Beacon as my CMS to enable content editing for certain pages on the deployed app without having to worry about rebuilding and redeploying.
For this to work, I need a way to be able to get access to the assigns variable for the session (and possibly the page as well, but that is less important for now). This is so that I can see things like the currently logged in user (via ash_authentication) and have access to other Ash features, too.
At the moment, there is an issue when specifying routes that are handled by
beacon_site
as they do not work if there are any extra params to thescope
command inrouter.ex
.So, for example, this will work:
But this will not:
If I try the above, I get the following compilation error:
Which I guess is because
beacon_site
is not defined for theMscmsWeb
scope. But I would be the first to admit that I really have no idea, as I'm just guessing ... :)In the above example, I need to run those
beacon_site
calls thru thescope
with theMscmsWeb
parameters as that is where all of the Ash goodies are invoked. For example, if I wanted to ensure that some parts of the Beacon pages are only accessible to a logged in user, I'd need to run them through that scope, and then on some of the Beacon pages I'd need to be able to inspect the session for:current_user
inassigns
.Ash and Beacon are both great pieces of software so it would be excellent if I was able to use them together.
Additional Context
There is long discussion on this feature on the
#beacon_cms
channel on the Elixir Slack, which you can see here:https://elixir-lang.slack.com/archives/C02T04D147M/p1731262689149579
Environment
The text was updated successfully, but these errors were encountered: