btcpayserver/BTCPayServer/Extensions/UrlHelperExtensions.cs

29 lines
979 B
C#
Raw Normal View History

using System;
2017-09-13 15:47:34 +09:00
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Controllers;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
2017-09-13 15:47:34 +09:00
namespace Microsoft.AspNetCore.Mvc
{
public static class UrlHelperExtensions
{
public static string EmailConfirmationLink(this LinkGenerator urlHelper, string userId, string code, string scheme, HttpContext context)
2017-09-13 15:47:34 +09:00
{
return urlHelper.GetUriByAction(context, nameof(AccountController.ConfirmEmail), "Account",
new {userId, code}, scheme);
2017-09-13 15:47:34 +09:00
}
public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string userId, string code, string scheme)
{
return urlHelper.Action(
action: nameof(AccountController.ResetPassword),
controller: "Account",
values: new { userId, code },
protocol: scheme);
}
}
}