Auto generated `reset_password_with_token` not loading user
Hi everyone! đź‘‹
I’m trying to expose the auto-generated
reset_password_with_token
action via Ash GraphQL, but I keep getting a not_found
error no matter what I try.
Here’s my setup (auto generated):
GraphQL block:
I am calling the API like so:
I also tried without the identity block and passing the token in headers - no luck. Shouldn’t the token automatically load the user? Or am I missing a step? Would really appreciate help from anyone who’s done this before!Solution:Jump to solution
seems like:
```
bypass action(:read) do
authorize_if expr(id == ^actor(:id))
end...
9 Replies
"not found" is kind of vague - what's the exact error you're seeing or what are your logs reporting?
right, what do your logs say? is it failing at trying to look up a user, or doing something else?
no errors reported in console, only log about mutation call:
when I try with
identity false
and call it, I get back similar error only with email
no longer being present in fields
here is my whole auth config:
I also tried corrupting the token & I am getting:
that makes me believe the token is right I also try logging out at ResetTokenValidation
to check if it goes over that and it did.What do your policies look like?
Solution
seems like:
is the issue 🤦‍♂️ after switching it to
authorize_if always()
it works now. I wonder how can I prevent users from reading the info of other users? 🤔Good question 🙂
Your best bet in the short term is to wrap the get/update in a generic action 🙂
I see, so basically within that newly formed action will be the "lookup" and user will be passed down to reset action, right?