Browse Source

Make GetChangeEmailTokenPurpose public (#17209)

Hao Kung 6 years ago
parent
commit
605c522fa3

+ 1 - 1
src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.netcoreapp.cs

@@ -576,7 +576,7 @@ namespace Microsoft.AspNetCore.Identity
         public virtual System.Threading.Tasks.Task<int> GetAccessFailedCountAsync(TUser user) { throw null; }
         public virtual System.Threading.Tasks.Task<string> GetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName) { throw null; }
         public virtual System.Threading.Tasks.Task<string> GetAuthenticatorKeyAsync(TUser user) { throw null; }
-        protected static string GetChangeEmailTokenPurpose(string newEmail) { throw null; }
+        public static string GetChangeEmailTokenPurpose(string newEmail) { throw null; }
         [System.Diagnostics.DebuggerStepThroughAttribute]
         public virtual System.Threading.Tasks.Task<System.Collections.Generic.IList<System.Security.Claims.Claim>> GetClaimsAsync(TUser user) { throw null; }
         [System.Diagnostics.DebuggerStepThroughAttribute]

+ 1 - 1
src/Identity/Extensions.Core/ref/Microsoft.Extensions.Identity.Core.netstandard2.0.cs

@@ -576,7 +576,7 @@ namespace Microsoft.AspNetCore.Identity
         public virtual System.Threading.Tasks.Task<int> GetAccessFailedCountAsync(TUser user) { throw null; }
         public virtual System.Threading.Tasks.Task<string> GetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName) { throw null; }
         public virtual System.Threading.Tasks.Task<string> GetAuthenticatorKeyAsync(TUser user) { throw null; }
-        protected static string GetChangeEmailTokenPurpose(string newEmail) { throw null; }
+        public static string GetChangeEmailTokenPurpose(string newEmail) { throw null; }
         [System.Diagnostics.DebuggerStepThroughAttribute]
         public virtual System.Threading.Tasks.Task<System.Collections.Generic.IList<System.Security.Claims.Claim>> GetClaimsAsync(TUser user) { throw null; }
         [System.Diagnostics.DebuggerStepThroughAttribute]

+ 1 - 5
src/Identity/Extensions.Core/src/UserManager.cs

@@ -2469,16 +2469,12 @@ namespace Microsoft.AspNetCore.Identity
             return cast;
         }
 
-
         /// <summary>
         /// Generates the token purpose used to change email.
         /// </summary>
         /// <param name="newEmail">The new email address.</param>
         /// <returns>The token purpose.</returns>
-        protected static string GetChangeEmailTokenPurpose(string newEmail)
-        {
-            return "ChangeEmail:" + newEmail;
-        }
+        public static string GetChangeEmailTokenPurpose(string newEmail) => "ChangeEmail:" + newEmail;
 
         /// <summary>
         /// Should return <see cref="IdentityResult.Success"/> if validation is successful. This is