Hi,
Yes, the steps are different with yours. It is about the register + login. And do not create tenant on page. Every register user (put in email) will create new tenant in backend.
Steps: 1, run Angular + ef app 2, go to login page, and click the register link to register page 3, put in email + pwd to register 4, create new tenant which tenant name is the put in email 5, register the putin email into this new tenant. 6, signin the new user and go back angular UI.
== =======================================================================
Detail I create custom register logic in this class. MyRegisterModel : RegisterModel
Here are my **steps **(logic):
1, Create Angular+ef app 2, create new file follow the custom login page: Create MyRegisterModel : RegisterModel 3, run the app 4, go to login page 5, click register link to register page 6, put in email and pwd
7, call this backend code RegisterLocalUserAsync3CreateTenant() of MyRegisterModel : RegisterModel
8, it will create Tenant with put in email as tenant name. (admin user is my hardcode another host email) 9, Using this new created tenant: using (CurrentTenant.Change(tenant.Id)) 10, create one general role for the new tenant. 11, register general user with put in email + pwd for the new tenant.
12, after the user created in the new tenant 13, it will call SignInManager.SignInAsync() 14, then Redirect(ReturnUrl ?? "/");
Then angular client will wait for about 15 seconds to refresh the page. And Result is correct. the put in email user will login the new tenant.
Please see my code for the Register.cshtml.cs
2, I use the domain to test. The identityserver logs and iis logs file, both empty, no data there.