Exemple #1
0
        public async Task <IActionResult> ChangePassword([FromBody] ChangePasswordRequest changePasswordRequest)
        {
            var passwordResponse = await _account.ChangePasswordAsync(GetUserId(), changePasswordRequest);

            if (!passwordResponse)
            {
                return(Ok(new AuthResponse
                {
                    Error = "Your Old Password is Incorrect"
                }));
            }

            return(Ok(new AuthResponse
            {
                Token = "Password Changed"
            }));
        }