Intergrating Gaurdian Plugs into AshGraphql
I want implement JWT validation checking using Guardian. Is there an example I could checkout . For context this is for
AshGraphQL
and I want the check done only when certain actions are called not all.
eg I have
elixir
above is the action I want to protect by putting it behind a valid session. how do I use a Guardian
plug that validates valid token to protect this action.2 Replies
@edwinofdawn I have a solution for you.
1. Define a plug that will pass the session resource (Customer) to Ash:
2. In your resource module, add the policy:
To run only on specific acations you'd do it like that