* Adding support for 2fa, more auth options * WIP getting auth stuff working * Added Manage views. 2FA working now for MVC app. * Switching to using a controller for no-UI logout scenario * Adding Razor Pages impl of 2FA auth stuff. Works.
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
namespace Microsoft.AspNetCore.Mvc
|
|
{
|
|
public static class UrlHelperExtensions
|
|
{
|
|
public static string GetLocalUrl(this IUrlHelper urlHelper, string localUrl)
|
|
{
|
|
if (!urlHelper.IsLocalUrl(localUrl))
|
|
{
|
|
return urlHelper.Page("/Index");
|
|
}
|
|
|
|
return localUrl;
|
|
}
|
|
|
|
public static string EmailConfirmationLink(this IUrlHelper urlHelper, string userId, string code, string scheme)
|
|
{
|
|
return urlHelper.Page(
|
|
"/Account/ConfirmEmail",
|
|
pageHandler: null,
|
|
values: new { userId, code },
|
|
protocol: scheme);
|
|
}
|
|
|
|
public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string userId, string code, string scheme)
|
|
{
|
|
return urlHelper.Page(
|
|
"/Account/ResetPassword",
|
|
pageHandler: null,
|
|
values: new { userId, code },
|
|
protocol: scheme);
|
|
}
|
|
}
|
|
}
|