Solved due to original enquiry deleted
Just wanted to note that I did not find a solution so I wrote my own customs endpoint
Apologies, you removed your query so I assumed the matter solved. Were you trying to update your password outside the admin panel?
Yes, not the password of the user collection, but a customer collection that has auth associated with it
So if the collection is not set as the
admin: {user: 'user-collection-slug' }
in the payload config then the idea is those users would not try to access the payload admin and /admin/account is unavailable to them. So if you wanted customers to change their own passwords you would need to build them a method in which they can do that.
As an admin. however, you can simply go to the collection item with auth enabled and select change password underneath the email field.
I just think that if you are going to allow users to add the auth property on any collection, then at a minimum document, if you are not going to include, the basic functionality for fully supporting that Auth property. I ran into the same issue with forgot password. These are basic expectations and should not require the LOE that it took me to 1) recognize it wasn’t supported and 2) figure out how to implement it
I'm sure the documentation would benefit from including a mention at the least. However, it is a headless CMS and checks the box for defining auth API endpoints (including reset password etc) allowing you to brand your own frontend with the UI for these features.
When I want others to access the Payload admin panel I simply add admins and other user types to the same user collection and include a role selector to define access controls from.
Thanks for your input, but you do not understand my use case or what I am trying to accomplish.
We are trying to solve different problems and you are narrowly defining the platform, and answering the question I didn’t ask.
I think PayloadCMS has a great future ahead, but it is new… I am not criticizing I am providing feedback
Hey @aaronksaunders I am catching up here, and I want to make sure I understand what you are looking for
you don't need to build anything custom to be able to forget / reset password for auth-enabled collections - it's done all out of the box for you
have you seen these docs and examples?
https://payloadcms.com/docs/authentication/operations#forgot-password
we also have a variety of auth boilerplates / examples / videos for how to accomplish everything you need for authentication
here is a full boilerplate that shows how to give your users control to set / change their own passwords:
https://github.com/payloadcms/payload/tree/main/examples/auth
are we missing anything? what were you looking for, which you could not find?
I am trying to change password not forget password. I am trying to push beyond the traditional CMS and use Payload as both CMS and application server support users of the application not just content admins.
yes, you can do that out of the box, take a look at the above auth example, there is an account view that shows how to change pw
that is fantastic - we do stuff like what you are trying to do very frequently
I will try again, but I tried and it didn’t work, was getting a error on model find one… it works perfectly if the collection is user, but fails if the auth collection is not user
@jmikrut so I found it, I was looking for a specific api call for change password, did not expect that you could just patch the model and change the password. Thanks for pointing me in right direction. Next up is social auth, is there an example for that somewhere?
well, there are a few community plugins for OAuth but I can't vouch for their quality because I've never used them. We offer SSO for enterprise but have not released anything as open source. You could build one, but that would be something you'd need to build on your own. We may have more news on this topic in the coming months though
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.