3
case class ResetPasswordJsonValidation (id : String ,email : String)
object ResetPasswordJsonValidation {
implicit val resetPasswordRead : Reads[ResetPasswordJsonValidation]= (
(JsPath \ "email").read(email) and
(JsPath \ "id").read(id))
(ResetPasswordJsonValidation.apply _)
}
def resetPassword = Action {
request =>
request.body.asJson.get.validate[ResetPasswordJsonValidation].fold(
resetPassword =>
{
log.info("id is {}" ,resetPassword.id)
log.info("email id is {}" ,resetPassword.email)
}
)
}
에 게시물 방법이있는 작업에 리디렉션어떻게 루트 파일에 플레이 프레임 워크
POST /direct-user/reset-password controllers.DirectUserController.resetPassword
이 내가 지금이 길
#!/bin/bash
contentType="Content-type: application/json";
data='{ "id" : "54d3732d-d728-40d3-ae63-b18ab6be8e70" ,
"email":"[email protected]"}';
echo " "
echo "------------------ Sending Data ------------------"
echo " "
echo "Content-Type : " $contentType
echo "Data : " $data
echo " "
echo "------------------ Response ------------------"
echo " "
echo " "
curl --include --request POST --header "Content-type: application/json" --data "$data" http://localhost:9000//direct-user/reset-password
을 공격하는 데 사용되는 컬 파일입니다 내가 코드를 가지고이 작업을 수행하고 싶습니다.
resetPassword
으로 리다이렉션해야하는 액션
A
액션 내가 어떻게하는지 모르겠습니다. 도와주세요.
012 3,516,
def A = Action {
var email:String="[email protected]"
var id:String="54d3732d-d728-40d3-ae63-b18ab6be8e70"
Redirect(routes.DirectUserController.resetPassword())//how can i send email and id parameter to resetPassword as its getting from curl file
}
이
반환 directController.resetPassword()를
직접 대신 루트 객체를 통해 그 방법을 호출 할 수 있습니다 대신 리디렉션의
사용자가 해당 URL directl에 게시하는 대신이 작업을 수행하려는 이유를 알려주십시오. 와이? – rethab
왜냐하면 액션 A가 5 번 실패한 시도 후에 사용자를 차단하고 있기 때문입니다. 비밀번호 재설정 작업으로 리디렉션됩니다. 간단하게하기 위해 코드를 생략했습니다. – swaheed
은 POST 작업 자체입니까? – mfirry