-
-
Notifications
You must be signed in to change notification settings - Fork 335
Open
Labels
Description
Lines 35 to 41 in b3e7e2b
| public void SignIn(string? customReturnUrl = null) | |
| { | |
| var returnUrl = customReturnUrl != null ? _navigation.ToAbsoluteUri(customReturnUrl).ToString() : null; | |
| var encodedReturnUrl = Uri.EscapeDataString(returnUrl ?? _navigation.Uri); | |
| var logInUrl = _navigation.ToAbsoluteUri($"{LogInPath}?returnUrl={encodedReturnUrl}"); | |
| _navigation.NavigateTo(logInUrl.ToString(), true); | |
| } |
var encodedReturnUrl = Uri.EscapeDataString(_navigation.ToBaseRelativePath(returnUrl ?? _navigation.Uri));
var logInUrl = _navigation.ToAbsoluteUri($"{LogInPath}?returnUrl=/{encodedReturnUrl}");
slash + _navigation.ToBaseRelativePath
otherwise problem in login (Url.IsLocalUrl)
Lines 12 to 23 in b3e7e2b
| [HttpGet("~/login")] | |
| public ActionResult LogIn(string returnUrl) | |
| { | |
| var properties = new AuthenticationProperties | |
| { | |
| // Only allow local return URLs to prevent open redirect attacks. | |
| RedirectUri = Url.IsLocalUrl(returnUrl) ? returnUrl : "/" | |
| }; | |
| // Ask the OpenIddict client middleware to redirect the user agent to the identity provider. | |
| return Challenge(properties, OpenIddictClientAspNetCoreDefaults.AuthenticationScheme); | |
| } |
Reactions are currently unavailable