diff --git a/Oqtane.Client/Modules/Admin/Users/Index.razor b/Oqtane.Client/Modules/Admin/Users/Index.razor index bad4ebe2..4a796298 100644 --- a/Oqtane.Client/Modules/Admin/Users/Index.razor +++ b/Oqtane.Client/Modules/Admin/Users/Index.razor @@ -60,9 +60,46 @@ else - +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
@@ -72,475 +109,432 @@ else
- @if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) + @if (_allowregistration == "true") { - @if (_allowregistration == "true") - { -
- -
- -
-
- }
- +
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
} +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
- @if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) - { -
-
- -
- -
-
-
- -
- -
-
-
- -
- +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+ + @if (!string.IsNullOrEmpty(_providerurl)) + { + @Localizer["Info"] + }
-
+ +
+
+
+ +
+ +
+
+ @if (_providertype != "") + {
- +
- +
-
+ + } + @if (_providertype == AuthenticationProviderTypes.OpenIDConnect) + {
- +
- +
- +
- +
-
- -
+ + } + @if (_providertype == AuthenticationProviderTypes.OAuth2) + {
- +
- +
-
+
- +
- +
-
-
-
+
- + +
+ +
+
+ } + @if (_providertype != "") + { +
+ +
+ +
+
+
+
- - @if (!string.IsNullOrEmpty(_providerurl)) - { - @Localizer["Info"] - } + +
-
-
- -
- -
-
- @if (_providertype != "") - { -
- -
- -
-
- } @if (_providertype == AuthenticationProviderTypes.OpenIDConnect) {
- +
- +
- +
- + +
+
+
+ +
+
} - @if (_providertype == AuthenticationProviderTypes.OAuth2) - { -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- } - @if (_providertype != "") - { -
- -
- -
-
-
- -
-
- - -
-
-
- @if (_providertype == AuthenticationProviderTypes.OpenIDConnect) - { -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- } -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
- - @if (_reviewclaims == "true") - { - @SharedLocalizer["Test"] - } -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- @if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) - { -
- -
- -
-
-
- -
- -
-
- } - } -
-
- + +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
- - + + @if (_reviewclaims == "true") + { + @SharedLocalizer["Test"] + }
-
+
- +
- +
-
+
- +
- +
-
+
- +
- +
-
+
- + +
+ +
+
+
+ +
+ +
+
+
+
- - +
-
-
- } + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ @if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) + { +
+ +
+ +
+
+ } + } + +
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+

@@ -553,13 +547,14 @@ else private string _deleted = "false"; private int _page = 1; - private string _allowregistration; - private string _registerurl; - private string _profileurl; - private string _requireconfirmedemail; + private string _allowsitelogin; + private string _twofactor; private string _loginlink; private string _passkeys; - private string _twofactor; + private string _allowregistration; + private string _registerurl; + private string _requireconfirmedemail; + private string _profileurl; private string _cookiename; private string _cookiedomain; private string _cookieexpiration; @@ -609,7 +604,6 @@ else private string _createusers; private string _verifyusers; private string _allowhostrole; - private string _allowsitelogin; private string _secret; private string _secrettype = "password"; @@ -633,12 +627,13 @@ else if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) { - _registerurl = SettingService.GetSetting(settings, "LoginOptions:RegisterUrl", ""); - _profileurl = SettingService.GetSetting(settings, "LoginOptions:ProfileUrl", ""); - _requireconfirmedemail = SettingService.GetSetting(settings, "LoginOptions:RequireConfirmedEmail", "true"); + _allowsitelogin = SettingService.GetSetting(settings, "LoginOptions:AllowSiteLogin", "true"); + _twofactor = SettingService.GetSetting(settings, "LoginOptions:TwoFactor", "false"); _loginlink = SettingService.GetSetting(settings, "LoginOptions:LoginLink", "false"); _passkeys = SettingService.GetSetting(settings, "LoginOptions:Passkeys", "false"); - _twofactor = SettingService.GetSetting(settings, "LoginOptions:TwoFactor", "false"); + _registerurl = SettingService.GetSetting(settings, "LoginOptions:RegisterUrl", ""); + _requireconfirmedemail = SettingService.GetSetting(settings, "LoginOptions:RequireConfirmedEmail", "true"); + _profileurl = SettingService.GetSetting(settings, "LoginOptions:ProfileUrl", ""); _cookiename = SettingService.GetSetting(settings, "LoginOptions:CookieName", ".AspNetCore.Identity.Application"); _cookiedomain = SettingService.GetSetting(settings, "LoginOptions:CookieDomain", ""); _cookieexpiration = SettingService.GetSetting(settings, "LoginOptions:CookieExpiration", ""); @@ -700,7 +695,6 @@ else _createusers = SettingService.GetSetting(settings, "ExternalLogin:CreateUsers", "true"); _verifyusers = SettingService.GetSetting(settings, "ExternalLogin:VerifyUsers", "true"); _allowhostrole = SettingService.GetSetting(settings, "ExternalLogin:AllowHostRole", "false"); - _allowsitelogin = SettingService.GetSetting(settings, "LoginOptions:AllowSiteLogin", "true"); } private async Task LoadUsersAsync() @@ -765,20 +759,21 @@ else { try { - var site = PageState.Site; - site.AllowRegistration = bool.Parse(_allowregistration); - await SiteService.UpdateSiteAsync(site); - - var settings = await SettingService.GetSiteSettingsAsync(site.SiteId); - if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) { - settings = SettingService.SetSetting(settings, "LoginOptions:RegisterUrl", _registerurl, false); - settings = SettingService.SetSetting(settings, "LoginOptions:ProfileUrl", _profileurl, false); - settings = SettingService.SetSetting(settings, "LoginOptions:RequireConfirmedEmail", _requireconfirmedemail, false); + var site = PageState.Site; + site.AllowRegistration = bool.Parse(_allowregistration); + await SiteService.UpdateSiteAsync(site); + + var settings = await SettingService.GetSiteSettingsAsync(site.SiteId); + + settings = SettingService.SetSetting(settings, "LoginOptions:AllowSiteLogin", _allowsitelogin, false); + settings = SettingService.SetSetting(settings, "LoginOptions:TwoFactor", _twofactor, false); settings = SettingService.SetSetting(settings, "LoginOptions:LoginLink", _loginlink, false); settings = SettingService.SetSetting(settings, "LoginOptions:Passkeys", _passkeys, false); - settings = SettingService.SetSetting(settings, "LoginOptions:TwoFactor", _twofactor, false); + settings = SettingService.SetSetting(settings, "LoginOptions:RegisterUrl", _registerurl, false); + settings = SettingService.SetSetting(settings, "LoginOptions:RequireConfirmedEmail", _requireconfirmedemail, false); + settings = SettingService.SetSetting(settings, "LoginOptions:ProfileUrl", _profileurl, false); settings = SettingService.SetSetting(settings, "LoginOptions:CookieName", _cookiename, true); settings = SettingService.SetSetting(settings, "LoginOptions:CookieDomain", _cookiedomain, true); settings = SettingService.SetSetting(settings, "LoginOptions:CookieExpiration", _cookieexpiration, true); @@ -824,16 +819,15 @@ else settings = SettingService.SetSetting(settings, "ExternalLogin:CreateUsers", _createusers, true); settings = SettingService.SetSetting(settings, "ExternalLogin:VerifyUsers", _verifyusers, true); settings = SettingService.SetSetting(settings, "ExternalLogin:AllowHostRole", _allowhostrole, true); - settings = SettingService.SetSetting(settings, "LoginOptions:AllowSiteLogin", _allowsitelogin, false); settings = SettingService.SetSetting(settings, "JwtOptions:Secret", _secret, true); settings = SettingService.SetSetting(settings, "JwtOptions:Issuer", _issuer, true); settings = SettingService.SetSetting(settings, "JwtOptions:Audience", _audience, true); settings = SettingService.SetSetting(settings, "JwtOptions:Lifetime", _lifetime, true); - } - await SettingService.UpdateSiteSettingsAsync(settings, site.SiteId); - await SettingService.ClearSiteSettingsCacheAsync(); + await SettingService.UpdateSiteSettingsAsync(settings, site.SiteId); + await SettingService.ClearSiteSettingsCacheAsync(); + } if (!string.IsNullOrEmpty(_secret)) { diff --git a/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx b/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx index 8d1bd113..57eecaca 100644 --- a/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx +++ b/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx @@ -217,7 +217,7 @@ Unique Characters: - Do you want to allow users to sign in using a username and password that is managed locally on this site? Note that you should only disable this option if you have already sucessfully configured an external login provider, or else you may lock yourself out of the site. + Do you want to allow users to sign in using a username and password that is managed locally on this site? Note that you should only disable this option if you have already successfully configured an alternate login method, or else you may lock yourself out of the site. Allow Local Login? @@ -370,7 +370,7 @@ Do you want users to use two factor authentication? Note that you should use the Disabled option until you have successfully verified that the Notification Job in Scheduled Jobs is enabled and your SMTP options in Site Settings are configured or else you will lock yourself out. - Two Factor Authentication? + Use 2FA? Do you want to require registered users to verify their email address before they are allowed to log in?