2

I have 3 different use case were i want to create a sysusers, in same model:

  • in on-boarding process of my customers to the platform my customers
  • co-workers register to be users on their organization from email
  • invite my customers customers register a account in the checkout
    process.

And I want them to enter their new password i the process. How do I solve this best?

2 Answers2

1

In the latest version the returnUrl is kept even when the user goes through register and that solves the issue. Thanks MDriven for absolutely terrific support!

0

Even if it is possible to go this route I would suggest that you flip it the other way around. Ask the user to create an account. Once they have an account you promote that account to being coworker and/or customer by setting some state on the already existing sysuser.

... Have a UserInvite object - email the link to a page where the invite is accepted - in the accept page show user link to register or login if they have not done that. Once you have a CurrentUser and UserInviteObject in scope you can tie it all together and be done think.

Hans Karlsen
  • 2,275
  • 1
  • 15
  • 15
  • I did like this: - Add class UserInvite with ref to Person - Add Singleton OneUserInviteSession with ref to UserInvite - Add userinvite object to a Person - Send Link to Person - Add VM that look up the userinvite object and set userinvite ref to the oneUserInviteSesssion from the link and show link to /account/register - Add dispatch on index that check if current user dont have ref to person and the OneUserInviteSession singleton have ref to a userinvite object. Problem is that UserInvite ref to OneUserInviteSession is null. Am I doing it wrong? – Bengt Henriksson May 14 '20 at 20:54
  • Think you lost me but: When the person switches from not being logged in to becoming logged in he gets a new context - so any transient values you have set will be lost. – Hans Karlsen May 16 '20 at 15:58
  • Then I dont understand how to connect the newly created sysuser with the pre created person object after the invited user done the registration. – Bengt Henriksson May 16 '20 at 18:47
  • Let the Invite view have a button "accept" and have the AcceptInviteView be accessible to LoggedIn users only (by accessgroup) - the user creates account or log in - and is returned to AcceptInviteView - tie the user to the invite object in an action in the AcceptInviteView (or similair - the trick is to only rely on stuff in url and not in context) – Hans Karlsen May 17 '20 at 13:50
  • It don't work because when user click Register the returnURL ( http://localhost:8182/Account/Login?returnURL=Turnkey%2fAngularApp%23%2fUserRegistration%2f55!1612) will truncated (http://localhost:8182/Account/Register) and after registration the user end up on the index page instead. – Bengt Henriksson May 19 '20 at 10:57
  • Ok - so maybe the issue is: When redirected to login and user chose "register" - then the returnUrl is not kept from initial target – Hans Karlsen May 19 '20 at 11:26
  • Yes, can this be fixed? – Bengt Henriksson May 19 '20 at 18:29