Skip to content

Commit

Permalink
Merge pull request #1 from KenTanaka/main
Browse files Browse the repository at this point in the history
・不要ロジックの削除
  • Loading branch information
chihiro-adachi authored Mar 15, 2023
2 parents 3e25c03 + 474400d commit 8b8c513
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Controller/TwoFactorAuthCustomerSmsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TwoFactorAuthCustomerSmsController extends TwoFactorAuthCustomerController
*/
public function inputPhoneNumber(Request $request)
{
if ($this->isAuth()) {
if ($this->isTwoFactorAuthed()) {
return $this->redirectToRoute($this->getCallbackRoute());
}

Expand Down Expand Up @@ -86,7 +86,7 @@ public function inputPhoneNumber(Request $request)
*/
public function inputToken(Request $request)
{
if ($this->isAuth()) {
if ($this->isTwoFactorAuthed()) {
return $this->redirectToRoute($this->getCallbackRoute());
}

Expand Down
13 changes: 13 additions & 0 deletions Resource/config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
eccube:
rate_limiter:
sms_send_onetime_request:
# 実行するルーティングを指定します。
route: plg_customer_2fa_sms_send_onetime
# 実行するmethodを指定します。デフォルトはPOSTです。
method: [ 'POST' ]
# スロットリングの制御方法を設定します。ip・customerを指定できます。
type: [ 'ip', 'customer' ]
# 試行回数を設定します。
limit: 5
# インターバルを設定します。
interval: '30 minutes'
5 changes: 4 additions & 1 deletion Resource/locale/messages.ja.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
admin.customer.2fa.sms.title: SMS認証情報
admin.customer.2fa.sms.authed_phone_number: 2段階認証電話番号

front.2fa.sms.resend.message: |
末尾%phoneの携帯電話に認証コードを送信します。
[認証コードを送信]をクリックしてください。
[認証コードを送信]をクリックしてください。
4 changes: 2 additions & 2 deletions Resource/template/admin/customer_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="card rounded border-0 mb-4" id="two_factor_auth_sms_setting">
<div class="card-header">
<div class="row">
<div class="col-8"><span class="card-title">SMS認証情報</span>
<div class="col-8"><span class="card-title">{{ 'admin.customer.2fa.sms.title'|trans }}</span>
</div>
<div class="col-4 text-end">
<a data-bs-toggle="collapse" href="#ordererInfo"
Expand All @@ -30,7 +30,7 @@
<div class="card-body">
<div class="row mb-2">
<div class="col-3">
<span>2段階認証時の電話番号</span>
<span>{{ 'admin.customer.2fa.sms.authed_phone_number'|trans }}</span>
</div>
<div class="col">
{{ form_widget(form.two_factor_authed_phone_number) }}
Expand Down

0 comments on commit 8b8c513

Please sign in to comment.