craftql icon indicating copy to clipboard operation
craftql copied to clipboard

[Enhancement] User Authentication / Account Creation & Management

Open edolyne opened this issue 6 years ago • 6 comments

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.

edolyne avatar Apr 11 '18 23:04 edolyne

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?

markhuot avatar Apr 12 '18 10:04 markhuot

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.

markhuot avatar Jun 21 '18 20:06 markhuot

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.

edolyne avatar Jun 28 '18 13:06 edolyne

+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 avatar Oct 11 '18 08:10 gertst

@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.

markhuot avatar Oct 11 '18 12:10 markhuot

Hi. When you plan to add this functionality? It will be awesome solution.

ManiakMill avatar Feb 16 '19 11:02 ManiakMill