-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAJOR REVAMP TO ACCOUNT/POST-REDIRECT-GET:
-Added missing FluentValidation initializer in StartupConfig.cs - Fixed bug with Account System where ViewModel wasn't passed in Post-Redirect-Get, so added to IModelStateService calls to Store, Get, and Clear (when redirecting off) the ViewModel, and updated the Account features to leverage this. -Fixed regex issue on Password Policy -Removed "Public" default user logic on UserRepository.GetUser(user identity). Still returns Public on GetCurrentUser() though if no logged in user found.
- Loading branch information
1 parent
973f2a3
commit 14189cb
Showing
39 changed files
with
277 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
MVC/MVC.Libraries/Services/Interfaces/IModelStateService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Microsoft.AspNetCore.Mvc.ModelBinding; | ||
using Microsoft.AspNetCore.Mvc.ViewFeatures; | ||
using MVCCaching; | ||
using System; | ||
|
||
namespace Generic.Services.Interfaces | ||
{ | ||
public interface IModelStateService : IService | ||
{ | ||
/// <summary> | ||
/// Merges the Model State (Validation state and errors) from the TempData, this should be called in Post-Redirect-Get methedology so the model state can persist between the POST action and the redirected GET. | ||
/// </summary> | ||
/// <param name="modelState"></param> | ||
/// <param name="tempData"></param> | ||
void MergeModelState(ModelStateDictionary modelState, ITempDataDictionary tempData); | ||
|
||
/// <summary> | ||
/// Stores the View model in the Temp Data, this is used in Post-Redirect-Get when the controller's POST modifies the view model and then redirects to the original request. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="tempData"></param> | ||
/// <param name="viewModel"></param> | ||
void StoreViewModel<T>(ITempDataDictionary tempData, T viewModel); | ||
|
||
/// <summary> | ||
/// Gets the View Model from the TempData, used in Post-Redirect-Get when redirecting back to the original request. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="tempData"></param> | ||
/// <returns></returns> | ||
T GetViewModel<T>(ITempDataDictionary tempData); | ||
|
||
/// <summary> | ||
/// Removes the View Model from TempData, this should be called if you are redirecting away from the calling view. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="tempData"></param> | ||
void ClearViewModel<T>(ITempDataDictionary tempData); | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
MVC/MVC.Libraries/Services/Interfaces/IViewComponentTempDataService.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 17 additions & 3 deletions
20
MVC/MVC/Features/Account/ForgotPassword/ForgotPasswordViewComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
MVC/MVC/Features/Account/ForgotPassword/ForgotPasswordViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
MVC/MVC/Features/Account/ForgottenPasswordReset/ForgottenPasswordReset.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.