craftql
craftql copied to clipboard
[Enhancement] User Authentication / Account Creation & Management
Would it be possible to allow user authentication, account creation, and management through CraftQL?
Thinking through the possibility of using CraftQL to power a custom membership site that would leverage craft, commerce, users and user groups.
This seems “possible.” But I’m not sure of the exact mechanics…
- account creation could be a field,
upsertUser
, but there’d need to be a way to secure that, maybe users can only come in as pending… -
upsertUser
could be limited to only allow you to modify your own user, e.g. don’t accept a user ID because it’s always fixed to the logged in user - not sure we could do login on the front side unless we’re doing token auth, though. E.g., the only thing CraftQL could do would be to accept a user ID and generate a session cookie, but that would allow anyone to log in as anyone. How are you planning login?
Is this still a requirement for you? I'm working on some parts of this over in #89 and could probably bring some of these things in to the fold.
Yes this is still a requirement. Currently it’s for a longer range project sthat will need integration with Craft Commerce so it’s not an immediate need. I’ll take a look at #89.
+1 A way to only see entries belonging to the logged in user would help me a lot. I can't use CraftQL now because of this limitation.
@gertst, this is implemented over in #89 but not yet tagged in a stable release. It adds a top level authorize
field that allows you to log in as a user. Then, after logging in you're only shown entries that user has access to. I'll be working on cleaning this branch up over the next few months and getting it released.
Hi. When you plan to add this functionality? It will be awesome solution.