How to create stormpath user without password? -
some users of our application admins. want give them capability create new users. think following flow:
- admin goes "users" page , clicks "create new user" button , fill new user's name , email address.
- that new user retrieves email acknowledge user created in our application.
- the user clicks link email body , proceeds "set password" page , specify password.
is possible achieve such flow angular + express? there other possible flows can achieved?
you can create invite-based flow, you'll have custom work our libraries.
you'll need work stormpath client , stormpath application directly, these provided stormpath node sdk. inside of express middleware, retrieve client with:
var stormpathclient = req.app.get('stormpathclient')
and application with:
var stormpathapplication = req.app.get('stormpathapplication`)
on application, use stormpathapplication.createaccount() create user. when pass new account data, set password long, random, , un-guessable. if stormpath directory has email verification enabled, user invite email. email should link them angular application, custom view read email verification token url , post custom middleware on server. middleware need use stormpathclient.verifyaccountemail() verify token.
then can collect new password user, , save setting req.user.password='new password', calling req.user.save().
hope helps! work @ stormpath , maintainer of these libraries :)
Comments
Post a Comment