-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Forgot password API - reject requests with invalid email format #9179
Conversation
|
efeb4ea
to
55dff1c
Compare
const error = validationResult(req); | ||
if (!error.isEmpty()) { | ||
throw Error('invalid email format'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは必要? express middleware で当てている validator に引っ掛かればそちらでエラーを出してくれるはず。なので validatrion エラーがあればそもそもここに到達しないのでは?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apiV3FormValidator が用意されているのでそちらを使う
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました。
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 8bbf17d |
タスク
forgot-password api へのメールヘッダインジェクション対応
pr and merge: https://redmine.weseek.co.jp/issues/154297
修正後の挙動
正しい挙動
この例のエラーは、メールが正しいと判断された後のエラー
今回のタスク要件は満たしています。
エラー時の挙動
不適切なメールアドレスに対しエラーを出します