@@ -45,6 +45,7 @@ public class AccountController : IdentityServerController
4545 private readonly IAuthenticationSchemeProvider schemeProvider ;
4646 private readonly LearningHubAuthConfig authConfig ;
4747 private readonly WebSettings webSettings ;
48+ private readonly ILogger logger ;
4849
4950 /// <summary>
5051 /// Initializes a new instance of the <see cref="AccountController"/> class.
@@ -55,6 +56,7 @@ public class AccountController : IdentityServerController
5556 /// <param name="events">events parameter.</param>
5657 /// <param name="userService">userService parameter.</param>
5758 /// <param name="webSettings">webSettings parameter.</param>
59+ /// <param name="logger">ILogger instance.</param>
5860 /// <param name="authConfig">Auth service config.</param>
5961 /// <param name="cacheService">Cacje service config.</param>
6062 public AccountController (
@@ -64,6 +66,7 @@ public AccountController(
6466 IEventService events ,
6567 IUserService userService ,
6668 WebSettings webSettings ,
69+ ILogger < AccountController > logger ,
6770 IOptions < LearningHubAuthConfig > authConfig ,
6871 ICacheService cacheService )
6972 : base ( userService , events , clientStore , webSettings , cacheService )
@@ -72,6 +75,7 @@ public AccountController(
7275 this . schemeProvider = schemeProvider ;
7376 this . authConfig = authConfig ? . Value ;
7477 this . webSettings = webSettings ;
78+ this . logger = logger ;
7579 }
7680
7781 /// <summary>
@@ -396,6 +400,12 @@ private async Task<LoginViewModel> BuildLoginViewModelAsync(string returnUrl)
396400 }
397401 }
398402
403+ if ( context == null || loginClientTemplate == null )
404+ {
405+ string message = context == null ? "context" : loginClientTemplate == null ? "clientTemplate" : string . Empty ;
406+ this . logger . LogWarning ( $ "return url has no { message } : { returnUrl } ") ;
407+ }
408+
399409 return new LoginViewModel
400410 {
401411 AllowRememberLogin = loginClientTemplate ? . AllowRememberLogin ?? AccountOptions . AllowRememberLogin ,
0 commit comments