vnext
Paul Schneider 5 years ago
parent 3991d30681
commit cc6a6b8425
3 changed files with 24 additions and 30 deletions

@ -65,6 +65,8 @@ status() {
start() { start() {
# wait a little for postgresql to be available
sleep 1
for env in $CONFIGS for env in $CONFIGS
do do
setdnxenv "$env" setdnxenv "$env"

@ -25,7 +25,7 @@ namespace Yavsc.Models.Messaging
using Interfaces.Workflow; using Interfaces.Workflow;
/// <summary> /// <summary>
/// /// Base event. /// Base event.
/// </summary> /// </summary>
public abstract class BaseEvent : IEvent { public abstract class BaseEvent : IEvent {
@ -35,12 +35,12 @@ namespace Yavsc.Models.Messaging
} }
public BaseEvent(string topic) public BaseEvent(string topic)
{ {
Topic = GetType().Name+"/"+topic; Topic = GetType().Name + "/" + topic;
} }
public string Topic { get; private set; } public string Topic { get; private set; }
public string Sender { get; set; } public string Sender { get; set; }
abstract public string CreateBody(); public abstract string CreateBody();
} }

@ -26,21 +26,21 @@ namespace Yavsc.Controllers
public class AccountController : Controller public class AccountController : Controller
{ {
const string nextPageTokenKey = "nextPageTokenKey"; private const string nextPageTokenKey = "nextPageTokenKey";
const int defaultLen = 10; private const int defaultLen = 10;
private readonly UserManager<ApplicationUser> _userManager; private readonly UserManager<ApplicationUser> _userManager;
private readonly SignInManager<ApplicationUser> _signInManager; private readonly SignInManager<ApplicationUser> _signInManager;
private readonly IEmailSender _emailSender; private readonly IEmailSender _emailSender;
// private readonly ISmsSender _smsSender; // private readonly ISmsSender _smsSender;
private readonly ILogger _logger; private readonly ILogger _logger;
SiteSettings _siteSettings; readonly SiteSettings _siteSettings;
TwilioSettings _twilioSettings; readonly TwilioSettings _twilioSettings;
IStringLocalizer _localizer; readonly IStringLocalizer _localizer;
// TwilioSettings _twilioSettings; // TwilioSettings _twilioSettings;
ApplicationDbContext _dbContext; readonly ApplicationDbContext _dbContext;
public AccountController( public AccountController(
@ -53,13 +53,10 @@ namespace Yavsc.Controllers
ApplicationDbContext dbContext) ApplicationDbContext dbContext)
{ {
_userManager = userManager; _userManager = userManager;
_signInManager = signInManager; _signInManager = signInManager;
var emailUserTokenProvider = new UserTokenProvider(); var emailUserTokenProvider = new UserTokenProvider();
_userManager.RegisterTokenProvider("EmailConfirmation", emailUserTokenProvider); _userManager.RegisterTokenProvider("EmailConfirmation", emailUserTokenProvider);
_userManager.RegisterTokenProvider("ResetPassword", emailUserTokenProvider); _userManager.RegisterTokenProvider("ResetPassword", emailUserTokenProvider);
// _userManager.RegisterTokenProvider("SMS",new UserTokenProvider()); // _userManager.RegisterTokenProvider("SMS",new UserTokenProvider());
// _userManager.RegisterTokenProvider("Phone", new UserTokenProvider()); // _userManager.RegisterTokenProvider("Phone", new UserTokenProvider());
_emailSender = emailSender; _emailSender = emailSender;
@ -171,7 +168,7 @@ namespace Yavsc.Controllers
if (result.RequiresTwoFactor) if (result.RequiresTwoFactor)
{ {
return RedirectToAction(nameof(SendCode), new { ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }); return RedirectToAction(nameof(SendCode), new { returnUrl = model.ReturnUrl, rememberMe = model.RememberMe });
} }
if (result.IsLockedOut) if (result.IsLockedOut)
{ {
@ -219,7 +216,7 @@ namespace Yavsc.Controllers
return HttpBadRequest(); return HttpBadRequest();
} }
// Note: this still is not the redirect uri given to the third party provider, at building the challenge. // Note: this still is not the redirect uri given to the third party provider, at building the challenge.
var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = model.ReturnUrl }, protocol:"https" , host: Startup.Authority); var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { model.ReturnUrl }, protocol:"https", host: Startup.Authority);
var properties = _signInManager.ConfigureExternalAuthenticationProperties(model.Provider, redirectUrl); var properties = _signInManager.ConfigureExternalAuthenticationProperties(model.Provider, redirectUrl);
// var properties = new AuthenticationProperties{RedirectUri=ReturnUrl}; // var properties = new AuthenticationProperties{RedirectUri=ReturnUrl};
return new ChallengeResult(model.Provider, properties); return new ChallengeResult(model.Provider, properties);
@ -566,17 +563,12 @@ namespace Yavsc.Controllers
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713 // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713
// Send an email with this link // Send an email with this link
var code = await _userManager.GeneratePasswordResetTokenAsync(user); var code = await _userManager.GeneratePasswordResetTokenAsync(user);
var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code },
protocol: "https", host: Startup.Authority); protocol: "https", host: Startup.Authority);
var sent = await _emailSender.SendEmailAsync(user.UserName, user.Email, _localizer["Reset Password"],
await _emailSender.SendEmailAsync(user.UserName, user.Email, _localizer["Reset Password"],
_localizer["Please reset your password by following this link:"] + " <" + callbackUrl + ">"); _localizer["Please reset your password by following this link:"] + " <" + callbackUrl + ">");
return View("ForgotPasswordConfirmation", sent);
return View("ForgotPasswordConfirmation");
} }
// If we got this far, something failed, redisplay form // If we got this far, something failed, redisplay form

Loading…