0
csona created
Hi,
ASP.Net Zero Version: v10.2 ASP.Net Core + Angular
If we create a new tenant from the host login page, currently the system prompts to be redirected to the login screen for the admin user.
Is there a way to login the admin user automatically i.e. without having to be redirected to the login screen?
Thanks, Chaitanya
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
1 Answer(s)
-
0
Hi @csona,
After a new tenant is registered from the Host side, by default the system redirects you to the login page.
If you want the admin user to be logged in automatically, you can achieve this by following these steps:Enable the setting:
- Set "New registered tenants are active by default" to true.
Disable email confirmation:
- In Host Settings, set "Email confirmation required for login" to false.
Auto-login after tenant registration:
- After creating the new tenant, set the current TenantId and login the admin user manually: To do this, you need to go to
register-tenant.componentand update the else content in thesubscribemethod in the save method as given in the example below. When the user selects Subscription with the Paid type, it will direct them to the payment screen. You can perform the transaction in this else section after the payment process.
- After creating the new tenant, set the current TenantId and login the admin user manually: To do this, you need to go to
.subscribe((result: RegisterTenantOutput) => { this._tenantRegistrationHelper.registrationResult = result; if (parseInt(this.model.subscriptionStartType.toString()) === SubscriptionStartType.Paid) { this._router.navigate(['account/gateway-selection'], { queryParams: { paymentId: result.paymentId, }, }); } else { this._loginService.authenticateModel = new AuthenticateModel(); this._loginService.authenticateModel.userNameOrEmailAddress = this.model.adminEmailAddress; this._loginService.authenticateModel.password = this.model.adminPassword; this._loginService.authenticateModel.rememberClient = true; this._loginService.authenticateModel.twoFactorRememberClientToken = null; this._loginService.authenticateModel.twoFactorVerificationCode = null; this._loginService.authenticateModel.singleSignIn = true; this._loginService.authenticateModel.captchaResponse = null; this._loginService.authenticateModel.returnUrl = '/app/admin/hostDashboard'; abp.multiTenancy.setTenantIdCookie(result.tenantId); this._loginService.authenticate(); } });Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)