dungnguyen8134
dungnguyen8134
AEAsh Elixir
Created by axdc on 4/14/2023 in #support
Not seeing policy authorization errors
Have you check if actor.staff is true? policies look ok
17 replies
AEAsh Elixir
Created by axdc on 4/14/2023 in #support
Not seeing policy authorization errors
Have you added policy for :add_user action?
17 replies
AEAsh Elixir
Created by icecarrotbear on 2/28/2023 in #support
require authenticated user
That's great, thank you
24 replies
AEAsh Elixir
Created by icecarrotbear on 2/28/2023 in #support
require authenticated user
No I cannot find in the tutorial
24 replies
AEAsh Elixir
Created by icecarrotbear on 2/28/2023 in #support
require authenticated user
I think we should add this to AshAuthentication.Phoenix tutorial
24 replies
AEAsh Elixir
Created by icecarrotbear on 2/28/2023 in #support
require authenticated user
finally I remove the :session options and it works
ash_authentication_live_session :authenticated_only,
on_mount: [
{OrangeCmsWeb.LiveUserAuth, :live_user_required}
] do
scope "/" do
live "/p", ProjectLive.Index, :index
end
end
ash_authentication_live_session :authenticated_only,
on_mount: [
{OrangeCmsWeb.LiveUserAuth, :live_user_required}
] do
scope "/" do
live "/p", ProjectLive.Index, :index
end
end
24 replies
AEAsh Elixir
Created by icecarrotbear on 2/28/2023 in #support
require authenticated user
then I replace live_session with ash_authentication_live_session and I got this compile error
== Compilation error in file lib/orange_cms_web/router.ex ==
** (ArgumentError) invalid live_session :session

expected a map with string keys or an MFA tuple, got [{AshAuthentication.Phoenix.LiveSession, :generate_session, [nil]}, {AshAuthentication.Phoenix.LiveSession, :generate_session, []}]

(phoenix_live_view 0.18.16) lib/phoenix_live_view/router.ex:255: anonymous fn/3 in Phoenix.LiveView.Router.validate_live_session_opts/3
(elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 0.18.16) lib/phoenix_live_view/router.ex:226: Phoenix.LiveView.Router.__live_session__/3
lib/orange_cms_web/router.ex:52: (module)
(elixir 1.14.3) lib/kernel/parallel_compiler.ex:340: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
== Compilation error in file lib/orange_cms_web/router.ex ==
** (ArgumentError) invalid live_session :session

expected a map with string keys or an MFA tuple, got [{AshAuthentication.Phoenix.LiveSession, :generate_session, [nil]}, {AshAuthentication.Phoenix.LiveSession, :generate_session, []}]

(phoenix_live_view 0.18.16) lib/phoenix_live_view/router.ex:255: anonymous fn/3 in Phoenix.LiveView.Router.validate_live_session_opts/3
(elixir 1.14.3) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 0.18.16) lib/phoenix_live_view/router.ex:226: Phoenix.LiveView.Router.__live_session__/3
lib/orange_cms_web/router.ex:52: (module)
(elixir 1.14.3) lib/kernel/parallel_compiler.ex:340: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
24 replies
AEAsh Elixir
Created by icecarrotbear on 2/28/2023 in #support
require authenticated user
I copy code from ash_hq and it doesn't load current user
live_session :authenticated_only,
on_mount: [
{OrangeCmsWeb.LiveUserAuth, :live_user_required}
],
session: {AshAuthentication.Phoenix.LiveSession, :generate_session, []} do

scope "/" do
live "/p", ProjectLive.Index, :index
end
end
live_session :authenticated_only,
on_mount: [
{OrangeCmsWeb.LiveUserAuth, :live_user_required}
],
session: {AshAuthentication.Phoenix.LiveSession, :generate_session, []} do

scope "/" do
live "/p", ProjectLive.Index, :index
end
end
24 replies
AEAsh Elixir
Created by dungnguyen8134 on 3/15/2023 in #support
Does ash support multi tenancy with foreign key?
Thanks Zach, I searched wrong keyword 😄
6 replies
AEAsh Elixir
Created by dungnguyen8134 on 3/8/2023 in #support
code_interface not expose function
It takes time to get familiar with Ash. But it reduces lot of boilerplate. Thank you for your awesome work.
6 replies
AEAsh Elixir
Created by dungnguyen8134 on 3/8/2023 in #support
code_interface not expose function
Thank you for your help. I'm quite new to Ash. I'm using it for my side project.
6 replies