diff --git a/backend/app/Http/Controllers/Api/ChildrenController.php b/backend/app/Http/Controllers/Api/ChildrenController.php index 894d8b68..7614a5a5 100644 --- a/backend/app/Http/Controllers/Api/ChildrenController.php +++ b/backend/app/Http/Controllers/Api/ChildrenController.php @@ -200,7 +200,8 @@ KIKI承知システムを使って「聞いてない!」「言ってない! ]; try { - // DBに入ります。 + // DBに入る又は変えります。 + TelActivation::where('child_id', $result->id)->delete(); TelActivation::create($create); // SMSを送ります。 @@ -470,12 +471,11 @@ https://kikikan.jp/c-account/forgot-password/reset/'.$token; return ['status_code' => 400, 'error_messages' => ['パスワードの更新に失敗しました。']]; } - // if (isset($r->token)) { - // if (null === ($child_id = TelActivation::select('child_id')->where('token', $r->token)->first())) { - // return ['status_code' => 400, 'error_messages' => ['パスワードの更新に失敗しました。']]; - // } - // $child_id = (int)$child_id->child_id; - // } + if (isset($r->token)) { + if (null === (TelActivation::select('id')->where('token', $r->token)->first())) { + return ['status_code' => 400, 'error_messages' => ['パスワードの更新に失敗しました。']]; + } + } // バリデーションエラー $validate = Validator::make($r->all(), [