Closed sevenseacat closed 2 months ago
@sevenseacat I've pushed this to main
. Feel free to try it out, but it will be a few days at least before a proper release is cut. The two major changes are allowing read actions to be used with the post
route type, and adding a modify_conn/4
option that can be specified on any route. See the new authenticate-with-json-api.md
guide for more details.
Fantastic! Thank you 🫶
A standard API sign-in action from AA looks something like this -
And I came across two issues when trying to get this exposed in a JSON API.
This is a
read
action to return a user record, so ash_json_api seems to only support connecting this as aget
action (when it really should be apost
).If attempting to make it a post with
post :sign_in_with_longlife_token, route: "/sign_in"
, the following compilation error is raised -It expects that the action will always have an
accept
option, which reads don't support.get
route, a successful login doesn't return the auth token as part of the response, and it doesn't seem to be includable/selectable as its stored as part of the metadata on the record, not an attribute.