From a2ccde92409d883eda1ca00306fc666e04904259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Fri, 28 Jan 2022 21:41:36 +0900 Subject: [PATCH 1/3] =?UTF-8?q?BE=E5=81=B4=E3=81=A7login=E6=99=82=E3=81=AB?= =?UTF-8?q?expire=E3=82=BF=E3=82=A4=E3=83=A0=E3=82=92=E9=80=81=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=81=8C=E3=81=A7=E3=81=8D=E3=81=BE=E3=81=99?= =?UTF-8?q?=E3=81=8B=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/Http/Controllers/Api/AuthenticationTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/Http/Controllers/Api/AuthenticationTrait.php b/backend/app/Http/Controllers/Api/AuthenticationTrait.php index bf3588dc..76ef7242 100644 --- a/backend/app/Http/Controllers/Api/AuthenticationTrait.php +++ b/backend/app/Http/Controllers/Api/AuthenticationTrait.php @@ -127,7 +127,7 @@ trait AuthenticationTrait { // セッションを想像する $login_user_datum = $this->makeSession($this->getGuard(), $get->toArray()); - return ['status_code' => 200, 'params' => ['id' => $login_user_datum['id']]]; + return ['status_code' => 200, 'params' => ['id' => $login_user_datum['id'], 'expire' => env('SESSION_LIFETIME')]]; } public function logout () { From 92689b69113910b36afa2461a8aa503223190f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Fri, 28 Jan 2022 22:03:45 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E2=97=AF=20=EF=BC=94=EF=BC=8E=E5=AD=90B?= =?UTF-8?q?=E3=81=AF=E7=99=BB=E9=8C=B2=E5=AE=8C=E4=BA=86=E3=80=81=E5=AD=90?= =?UTF-8?q?C=E3=81=AF=E7=99=BB=E9=8C=B2=E3=81=AF=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E3=81=A0=E3=81=8C=E8=A6=AA=E3=81=A8=E3=83=AA=E3=83=AC=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=97=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/Http/Controllers/Api/ChildrenController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/Http/Controllers/Api/ChildrenController.php b/backend/app/Http/Controllers/Api/ChildrenController.php index 0d5af95d..be21046f 100644 --- a/backend/app/Http/Controllers/Api/ChildrenController.php +++ b/backend/app/Http/Controllers/Api/ChildrenController.php @@ -119,7 +119,9 @@ class ChildrenController extends Controller { // 親子関係の上限の場合 if (!is_null($get->father_id) && null !== ($rel = FatherRelation::where('father_id', $get->father_id)->first())) { - if (Father::select('relation_limit')->where('id', $get->father_id)->first()->relation_limit >= FatherRelation::where('father_id', $get->father_id)->count()) { + $fa = Father::select('relation_limit')->where('id', $get->father_id)->first(); + $fr = FatherRelation::where('father_id', $get->father_id)->count(); + if (null !== $fa && $fr >= $fa->relation_limit) { return ['status_code' => 400, 'error_messages' => ['仮登録の有効期限が切れました。改めて親にお問い合わせいただき、再登録の手続きを行ってください。']]; } } From fe2fe0b2477d67f8cdb5331d9cd859208a3d1b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Fri, 28 Jan 2022 22:18:44 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AD=90=E3=81=AEtel=5Factivations?= =?UTF-8?q?=E3=81=AE=E6=9C=89=E5=8A=B9=E6=9C=9F=E9=99=90=E3=81=8C=E5=88=87?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E3=81=AB=E3=82=82=E3=81=8B=E5=A4=89=E3=82=8F?= =?UTF-8?q?=E3=82=89=E3=81=9A=E3=80=81=E3=83=87=E3=83=BC=E3=82=BF=E3=81=8C?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=95=E3=82=8C=E3=81=BE=E3=81=9B=E3=82=93?= =?UTF-8?q?=E3=80=82email=5Factivations=E3=82=82=E5=90=8C=E6=A7=98?= =?UTF-8?q?=E3=81=8B=E3=81=A8=E6=80=9D=E3=81=84=E3=81=BE=E3=81=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/Http/Controllers/Api/ChildrenController.php | 8 +++++++- backend/app/Http/Controllers/Api/FathersController.php | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/backend/app/Http/Controllers/Api/ChildrenController.php b/backend/app/Http/Controllers/Api/ChildrenController.php index be21046f..03f5d927 100644 --- a/backend/app/Http/Controllers/Api/ChildrenController.php +++ b/backend/app/Http/Controllers/Api/ChildrenController.php @@ -96,7 +96,13 @@ class ChildrenController extends Controller { public function checkRegisterMain (Request $r) { // トークンの確認 - if (null === ($get = TelActivation::select('tel')->where('token', $r->token)->first())) { + if (null === ($get = TelActivation::select('tel', 'ttl')->where('token', $r->token)->first())) { + return ['status_code' => 400, 'error_messages' => ['不正な登録トークン。']]; + } + + // トークンの有効期限が切れた場合 + if (time() > strtotime($get->ttl)) { + TelActivation::where('token', $r->token)->delete(); return ['status_code' => 400, 'error_messages' => ['不正な登録トークン。']]; } diff --git a/backend/app/Http/Controllers/Api/FathersController.php b/backend/app/Http/Controllers/Api/FathersController.php index a446d388..7d3d037b 100644 --- a/backend/app/Http/Controllers/Api/FathersController.php +++ b/backend/app/Http/Controllers/Api/FathersController.php @@ -142,7 +142,13 @@ class FathersController extends Controller { public function checkRegisterMain (Request $r) { // トークンの確認 - if (null === ($get = EmailActivation::where('token', $r->token)->first())) { + if (null === ($get = EmailActivation::select('ttl')where('token', $r->token)->first())) { + return ['status_code' => 400, 'error_messages' => ['不正な登録トークン。']]; + } + + // トークンの有効期限が切れた場合 + if (time() > strtotime($get->ttl)) { + EmailActivation::where('token', $r->token)->delete(); return ['status_code' => 400, 'error_messages' => ['不正な登録トークン。']]; }