From a30bb60690bf9e11bc205b24a64842d51aac7c17 Mon Sep 17 00:00:00 2001 From: npalOmega Date: Mon, 7 Oct 2024 01:32:17 -0500 Subject: [PATCH] fixing temp password issue --- SeaHavenIndustries/Data/Services/AccountService.cs | 8 +++++++- SeaHavenIndustries/SeaHavenIndustries.csproj | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SeaHavenIndustries/Data/Services/AccountService.cs b/SeaHavenIndustries/Data/Services/AccountService.cs index ad80d51..971b0e6 100644 --- a/SeaHavenIndustries/Data/Services/AccountService.cs +++ b/SeaHavenIndustries/Data/Services/AccountService.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.WebUtilities; using Microsoft.EntityFrameworkCore; using OfficeOpenXml; +using PasswordGenerator; using SeaHavenIndustries.Data.IRepository; using SeaHavenIndustries.Helper; using SeaHavenIndustries.Helper.ViewModels; @@ -128,7 +129,12 @@ namespace SeaHavenIndustries.Data.Services model.UserName = model.Email; model.CreatedDate = DateTime.Now; model.UniqueName = "Active"; - var password = GenerateRandomPassword(8); + + var pwd = new Password(8).IncludeLowercase().IncludeUppercase().IncludeSpecial().IncludeNumeric(); + var password = pwd.Next(); + + + //var password = GenerateRandomPassword(8); var result = await _userManager.CreateAsync(model, password); if (result.Succeeded) { diff --git a/SeaHavenIndustries/SeaHavenIndustries.csproj b/SeaHavenIndustries/SeaHavenIndustries.csproj index e27efc6..11de19e 100644 --- a/SeaHavenIndustries/SeaHavenIndustries.csproj +++ b/SeaHavenIndustries/SeaHavenIndustries.csproj @@ -15,6 +15,7 @@ +