Skip to content

Commit 45941e8

Browse files
committed
tenant selection implemented.
1 parent 489ce2a commit 45941e8

File tree

4 files changed

+15
-26
lines changed

4 files changed

+15
-26
lines changed

src/AbpCompanyName.AbpProjectName.Core/AbpProjectNameCoreModule.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,14 @@ public override void PreInitialize()
2626

2727
AbpProjectNameLocalizationConfigurer.Configure(Configuration.Localization);
2828

29-
//todo@ismail -> check this.
30-
//Adding feature providers
31-
//Configuration.Features.Providers.Add<AppFeatureProvider>();
32-
3329
//Adding setting providers
3430
Configuration.Settings.Providers.Add<AppSettingProvider>();
3531

36-
//todo@ismail -> check this.
37-
//Adding notification providers
38-
//Configuration.Notifications.Providers.Add<AppNotificationProvider>();
39-
4032
//Enable this line to create a multi-tenant application.
4133
Configuration.MultiTenancy.IsEnabled = true;
4234

43-
//Enable LDAP authentication (It can be enabled only if MultiTenancy is disabled!)
44-
//Configuration.Modules.ZeroLdap().Enable(typeof(AppLdapAuthenticationSource));
45-
4635
//Configure roles
4736
AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement);
48-
49-
//todo@ismail -> check this.
50-
//if (DebugHelper.IsDebug)
51-
//{
52-
// //Disabling email sending in debug mode
53-
// IocManager.Register<IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient);
54-
//}
55-
56-
//todo@ismail -> check this.
57-
//Configuration.ReplaceService<IAbpSession, AspNetZeroAbpSession>();
58-
5937
}
6038

6139
public override void Initialize()

src/AbpCompanyName.AbpProjectName.Web/Controllers/AccountController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ public virtual async Task<ActionResult> ExternalLoginCallback(string returnUrl,
331331
default:
332332
return View("TenantSelection", new TenantSelectionViewModel
333333
{
334-
Action = Url.Action("ExternalLoginCallback", "Account", new { returnUrl }),
334+
Action = "ExternalLoginCallback",
335+
ReturnUrl = returnUrl,
336+
AuthSchema = authSchema,
335337
Tenants = tenants.MapTo<List<TenantSelectionViewModel.TenantInfo>>()
336338
});
337339
}

src/AbpCompanyName.AbpProjectName.Web/Models/Account/TenantSelectionViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ public class TenantSelectionViewModel
88
{
99
public string Action { get; set; }
1010

11+
public string ReturnUrl { get; set; }
12+
13+
public string AuthSchema { get; set; }
14+
1115
public List<TenantInfo> Tenants { get; set; }
1216

1317
[AutoMapFrom(typeof(Tenant))]

src/AbpCompanyName.AbpProjectName.Web/Views/Account/TenantSelection.cshtml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
@model AbpCompanyName.AbpProjectName.Web.Models.Account.TenantSelectionViewModel
1+
@using System.Net
2+
@using Microsoft.EntityFrameworkCore.Metadata.Internal
3+
@model AbpCompanyName.AbpProjectName.Web.Models.Account.TenantSelectionViewModel
24
@{
35
ViewBag.Title = "Select Tenant";
6+
ViewBag.DisableTopBar = true;
47
}
58
@section Styles
69
{
@@ -17,7 +20,9 @@
1720
<div class="col-lg-12">
1821
<div class="well bs-component">
1922

20-
<form action="@Model.Action" method="POST">
23+
<form asp-action="@(Model.Action)" method="POST">
24+
<input type="hidden" name="ReturnUrl" value="@Model.ReturnUrl"/>
25+
<input type="hidden" name="authSchema" value="@Model.AuthSchema" />
2126
<fieldset>
2227
<legend>@L("TenantSelection")</legend>
2328

@@ -43,7 +48,7 @@
4348
@tenant.Name (@tenant.TenancyName)
4449
</label>
4550
</div>
46-
}
51+
}
4752
</div>
4853
</div>
4954

0 commit comments

Comments
 (0)