File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,13 @@ public async Task<ActionResult> CheckUserRole()
102
102
/// <summary>
103
103
/// to check user password is correct.
104
104
/// </summary>
105
- /// <param name="currentPassword ">The currentPassword.</param>
105
+ /// <param name="password ">The currentPassword.</param>
106
106
/// <returns>The <see cref="Task{ActionResult}"/>.</returns>
107
- [ HttpGet ]
108
- [ Route ( "ConfirmPassword/{currentPassword} " ) ]
109
- public async Task < ActionResult > ConfirmPassword ( string currentPassword )
107
+ [ HttpPost ]
108
+ [ Route ( "ConfirmPassword" ) ]
109
+ public async Task < ActionResult > ConfirmPassword ( [ FromBody ] PasswordUpdateModel password )
110
110
{
111
- string passwordHash = this . userService . Base64MD5HashDigest ( currentPassword ) ;
111
+ string passwordHash = this . userService . Base64MD5HashDigest ( password . PasswordHash ) ;
112
112
var userPersonalDetails = await this . userService . GetCurrentUserPersonalDetailsAsync ( ) ;
113
113
if ( userPersonalDetails != null && userPersonalDetails . PasswordHash == passwordHash )
114
114
{
Original file line number Diff line number Diff line change @@ -67,16 +67,15 @@ const IsSystemAdmin = async function (): Promise<boolean[]> {
67
67
} ;
68
68
69
69
const IsValidUser = async function ( currentPassword : string ) : Promise < boolean [ ] > {
70
- let encodedPassword = encodeURIComponent ( currentPassword ) ;
71
- var IsValidUser = `/api/User/ConfirmPassword/${ encodedPassword } ` ;
72
- return await AxiosWrapper . axios . get < boolean [ ] > ( IsValidUser )
73
- . then ( response => {
74
- return response . data ;
75
- } )
76
- . catch ( e => {
77
- console . log ( 'IsValidUser:' + e ) ;
78
- throw e ;
70
+ try {
71
+ const response = await AxiosWrapper . axios . post < boolean [ ] > ( '/api/User/ConfirmPassword' , {
72
+ PasswordHash : currentPassword
79
73
} ) ;
74
+ return response . data ;
75
+ } catch ( e ) {
76
+ console . error ( 'IsValidUser:' , e ) ;
77
+ throw e ;
78
+ }
80
79
} ;
81
80
82
81
const getCurrentUserBasicDetails = async function ( ) : Promise < UserBasicModel > {
You can’t perform that action at this time.
0 commit comments