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()
102102 /// <summary>
103103 /// to check user password is correct.
104104 /// </summary>
105- /// <param name="currentPassword ">The currentPassword.</param>
105+ /// <param name="password ">The currentPassword.</param>
106106 /// <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 )
110110 {
111- string passwordHash = this . userService . Base64MD5HashDigest ( currentPassword ) ;
111+ string passwordHash = this . userService . Base64MD5HashDigest ( password . PasswordHash ) ;
112112 var userPersonalDetails = await this . userService . GetCurrentUserPersonalDetailsAsync ( ) ;
113113 if ( userPersonalDetails != null && userPersonalDetails . PasswordHash == passwordHash )
114114 {
Original file line number Diff line number Diff line change @@ -67,16 +67,15 @@ const IsSystemAdmin = async function (): Promise<boolean[]> {
6767} ;
6868
6969const 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
7973 } ) ;
74+ return response . data ;
75+ } catch ( e ) {
76+ console . error ( 'IsValidUser:' , e ) ;
77+ throw e ;
78+ }
8079} ;
8180
8281const getCurrentUserBasicDetails = async function ( ) : Promise < UserBasicModel > {
You can’t perform that action at this time.
0 commit comments