Skip to content

Commit 8b0f46c

Browse files
authored
Use Compount Assignment to respect IDE0054 (#24202)
* Use Compount Assignment to respect IDE0054
1 parent 990e639 commit 8b0f46c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Login.cshtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public override async Task OnGetAsync(string returnUrl = null)
109109
ModelState.AddModelError(string.Empty, ErrorMessage);
110110
}
111111

112-
returnUrl = returnUrl ?? Url.Content("~/");
112+
returnUrl ??= Url.Content("~/");
113113

114114
// Clear the existing external cookie to ensure a clean login process
115115
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
@@ -121,7 +121,7 @@ public override async Task OnGetAsync(string returnUrl = null)
121121

122122
public override async Task<IActionResult> OnPostAsync(string returnUrl = null)
123123
{
124-
returnUrl = returnUrl ?? Url.Content("~/");
124+
returnUrl ??= Url.Content("~/");
125125

126126
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
127127

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Register.cshtml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public override async Task OnGetAsync(string returnUrl = null)
126126

127127
public override async Task<IActionResult> OnPostAsync(string returnUrl = null)
128128
{
129-
returnUrl = returnUrl ?? Url.Content("~/");
129+
returnUrl ??= Url.Content("~/");
130130
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
131131
if (ModelState.IsValid)
132132
{

0 commit comments

Comments
 (0)