More work on nullable reference types

This commit is contained in:
Nikolaj Geisle
2022-03-31 14:35:23 +02:00
parent 2460c82e02
commit 4571ecb0e3
88 changed files with 388 additions and 340 deletions

View File

@@ -110,7 +110,7 @@ namespace Umbraco.Cms.Web.Common.Security
return result;
}
public override async Task<IdentityResult> ChangePasswordWithResetAsync(string userId, string token, string newPassword)
public override async Task<IdentityResult> ChangePasswordWithResetAsync(string userId, string token, string? newPassword)
{
IdentityResult result = await base.ChangePasswordWithResetAsync(userId, token, newPassword);
if (result.Succeeded)
@@ -121,7 +121,7 @@ namespace Umbraco.Cms.Web.Common.Security
return result;
}
public override async Task<IdentityResult> ChangePasswordAsync(BackOfficeIdentityUser user, string currentPassword, string newPassword)
public override async Task<IdentityResult> ChangePasswordAsync(BackOfficeIdentityUser user, string? currentPassword, string? newPassword)
{
IdentityResult result = await base.ChangePasswordAsync(user, currentPassword, newPassword);
if (result.Succeeded)
@@ -176,7 +176,7 @@ namespace Umbraco.Cms.Web.Common.Security
return currentUserId;
}
public void NotifyAccountLocked(IPrincipal? currentUser, string userId) => Notify(currentUser,
public void NotifyAccountLocked(IPrincipal? currentUser, string? userId) => Notify(currentUser,
(currentUserId, ip) => new UserLockedNotification(ip, userId, currentUserId)
);
@@ -196,7 +196,7 @@ namespace Umbraco.Cms.Web.Common.Security
(currentUserId, ip) => new UserLoginFailedNotification(ip, userId, currentUserId)
);
public void NotifyLoginRequiresVerification(IPrincipal currentUser, string userId) => Notify(currentUser,
public void NotifyLoginRequiresVerification(IPrincipal currentUser, string? userId) => Notify(currentUser,
(currentUserId, ip) => new UserLoginRequiresVerificationNotification(ip, userId, currentUserId)
);

View File

@@ -15,11 +15,11 @@ namespace Umbraco.Cms.Web.BackOffice.Security
AuthenticationProperties ConfigureExternalAuthenticationProperties(string provider, string? redirectUrl, string? userId = null);
Task<SignInResult> ExternalLoginSignInAsync(ExternalLoginInfo loginInfo, bool isPersistent, bool bypassTwoFactor = false);
Task<IEnumerable<AuthenticationScheme>> GetExternalAuthenticationSchemesAsync();
Task<ExternalLoginInfo> GetExternalLoginInfoAsync(string? expectedXsrf = null);
Task<ExternalLoginInfo?> GetExternalLoginInfoAsync(string? expectedXsrf = null);
Task<BackOfficeIdentityUser> GetTwoFactorAuthenticationUserAsync();
Task<SignInResult> PasswordSignInAsync(string userName, string password, bool isPersistent, bool lockoutOnFailure);
Task SignOutAsync();
Task SignInAsync(BackOfficeIdentityUser user, bool isPersistent, string? authenticationMethod = null);
Task SignInAsync(BackOfficeIdentityUser? user, bool isPersistent, string? authenticationMethod = null);
Task<ClaimsPrincipal> CreateUserPrincipalAsync(BackOfficeIdentityUser user);
Task<SignInResult> TwoFactorSignInAsync(string? provider, string? code, bool isPersistent, bool rememberClient);
Task<IdentityResult> UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin);