Creating a "recover password"-page for members (Umbraco 7)
Hello community!
I'm in the middle of a project, attempting to create a page where members can recover their password. Unfortunately, i'm probably too much of a newbie with MVC to figure out where to start this journey. Is this already accessible via the new MemberService API?
The recovery option must ask the member for his email (which is also the username), send the member an email with a link to reset, and then either give them a new password right away or allow them to enter a new one.
I would love some pointers on where to go from here. Keep in mind that it's been a while since i created a surface controller, so be as kind as possible! :) Thanks!
Also - perhaps this should be included in the new Member snippets?
It would be great if this stuff was built into Umbraco, in a similar way to how there are new partials to render login/registration forms. As far as I know though - and it'd be fantastic if someone could demonstrate otherwise (perhaps using the new Membership API which I've not looked at yet!) - it's not. The best I've found is Warren Buckley's Standard Membership which has code for the complete member cycle. It's not a 'package' and it's not super-straight forward to integrate into a project but the code is there and is great for cherry picking. Be prepared for a bit of a learning curve if you're an MVC noob.
I'd love it if someone had any quicker/easier solutions for doing this? Anyone...?
I have built a "forgotten password" function before that simply asks the member for their email (also their username). I then post this to a controller, use the MemberService to find the member. If the member exists, I generate a random password and email this to the user, and set a property on the member which I then use to force them to change this random password when they next login.
Works well for me, probably other ways to achieve the same thing.
@Dan - thanks for pointing me in that direction! :) I've been playing around a bit, trying to convert the entire thing into the new MemberService, but unfortunately it's a bit out of my league.. at least for right now!
@Chris - Cool! Could you elaborate a bit on that? Like how did you manage to change a custom member property? I've been searching for ages trying to solve that one! :)
I have this currently, from the old Member code, but it would seem the new Member doesn't allow me to just take the property i want - only the MemberProperties[].
Use the MemberService to get the member and then update the properties;
var ms = Services.MemberService; var member = ms.GetByUsername(model.Email); (or GetById etc etc) member.SetValue("passwordIsDefault", true); (passwordIsDefault is a true/false prop on my member type) ms.Save(member);
You can then do the same thing when you log the member in, but use member.GetValue("passwordIsDefault") and force the user to change their password.....
Creating a "recover password"-page for members (Umbraco 7)
Hello community!
I'm in the middle of a project, attempting to create a page where members can recover their password. Unfortunately, i'm probably too much of a newbie with MVC to figure out where to start this journey. Is this already accessible via the new MemberService API?
The recovery option must ask the member for his email (which is also the username), send the member an email with a link to reset, and then either give them a new password right away or allow them to enter a new one.
I would love some pointers on where to go from here. Keep in mind that it's been a while since i created a surface controller, so be as kind as possible! :) Thanks!
Also - perhaps this should be included in the new Member snippets?
// Thomas
Hi Thomas,
It would be great if this stuff was built into Umbraco, in a similar way to how there are new partials to render login/registration forms. As far as I know though - and it'd be fantastic if someone could demonstrate otherwise (perhaps using the new Membership API which I've not looked at yet!) - it's not. The best I've found is Warren Buckley's Standard Membership which has code for the complete member cycle. It's not a 'package' and it's not super-straight forward to integrate into a project but the code is there and is great for cherry picking. Be prepared for a bit of a learning curve if you're an MVC noob.
I'd love it if someone had any quicker/easier solutions for doing this? Anyone...?
Hi Thomas,
I have built a "forgotten password" function before that simply asks the member for their email (also their username). I then post this to a controller, use the MemberService to find the member. If the member exists, I generate a random password and email this to the user, and set a property on the member which I then use to force them to change this random password when they next login.
Works well for me, probably other ways to achieve the same thing.
Cheers
Chris
@Dan - thanks for pointing me in that direction! :) I've been playing around a bit, trying to convert the entire thing into the new MemberService, but unfortunately it's a bit out of my league.. at least for right now!
@Chris - Cool! Could you elaborate a bit on that? Like how did you manage to change a custom member property? I've been searching for ages trying to solve that one! :)
I have this currently, from the old Member code, but it would seem the new Member doesn't allow me to just take the property i want - only the MemberProperties[].
Thanks!
// Thomas
Hi Thomas,
Use the MemberService to get the member and then update the properties;
var ms = Services.MemberService;
var member = ms.GetByUsername(model.Email); (or GetById etc etc)
member.SetValue("passwordIsDefault", true); (passwordIsDefault is a true/false prop on my member type)
ms.Save(member);
You can then do the same thing when you log the member in, but use member.GetValue("passwordIsDefault") and force the user to change their password.....
That's it :-)
Cheers
Chris
Hi Guys,
Have you got the code snippet, for this functionality, including the generation of password, etcc..?
Thank you guys..
is working on a reply...