Can not access to actor from token in create action
Hi sorry, I think I might be making a silly mistake somewhere. As you can see, I don’t have access to the
actor
in the create
action — it’s always nil
. However, I don’t have this issue in the read
action, where I can access the actor without any problems.
But works inside my read action and i can print actor
I do not know why?
Thank you in advance and sorry again9 Replies
access to the actor, or the tenant?
Actor
context.actor |> IO.inspect(label: "=-=--==-=-=-=-")
ah I missed that. how are you calling the action?
With json api
This
get :me, route: "/me"
can access to actor, but the post :register_with_password
can not be ableso if this is a typical registration action, there is no actor
you're calling this as an unregistered user, to create an account
Yes, but in my system admin and guest can create account!! i do not know why i can not be able to access actor in change or validation
I do not know where it deletes actor
when the admin creates an account, I'm guessing also via the API, do they provide an authentication token? if not, there won't be an actor
I don't think the actor is being deleted
if there is an actor, is it in the
changeset
and not the context
?Sorry As i said in the first question, my
:me
works and i pass the token and i can see the actor in it! but in create for register i have this problem
if there is an actor, is it in the changeset and not the context?Unfortunately i can not see actor inside
changeset
and context
I think some place i am deleting this, idk :thinkies:Solution
i think i found it i am deleting it in my custom plug