Skip to content

Commit 50da7d2

Browse files
enhance(frontend): 2要素認証セットアップウィザードにアプリを起動するボタンを新設 (#13636)
* enhance(frontend): 2要素認証セットアップウィザードにアプリを起動するボタンを新設 * add comment * use css module
1 parent 2a85143 commit 50da7d2

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

locales/index.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4928,6 +4928,10 @@ export interface Locale extends ILocale {
49284928
* バックアップコードを使う
49294929
*/
49304930
"useBackupCode": string;
4931+
/**
4932+
* アプリを起動
4933+
*/
4934+
"launchApp": string;
49314935
"_bubbleGame": {
49324936
/**
49334937
* 遊び方
@@ -7542,13 +7546,9 @@ export interface Locale extends ILocale {
75427546
*/
75437547
"step1": ParameterizedString<"a" | "b">;
75447548
/**
7545-
* 次に、表示されているQRコードをアプリでスキャンします
7549+
* 次に、表示されているQRコードをアプリでスキャンするか、ボタンをクリックして端末上でアプリを開きます
75467550
*/
75477551
"step2": string;
7548-
/**
7549-
* QRコードをクリックすると、お使いの端末にインストールされている認証アプリやキーリングに登録できます。
7550-
*/
7551-
"step2Click": string;
75527552
/**
75537553
* デスクトップアプリを使用する場合は次のURIを入力します
75547554
*/

locales/ja-JP.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,7 @@ gameRetry: "リトライ"
12281228
notUsePleaseLeaveBlank: "使用しない場合は空欄にしてください"
12291229
useTotp: "ワンタイムパスワードを使う"
12301230
useBackupCode: "バックアップコードを使う"
1231+
launchApp: "アプリを起動"
12311232

12321233
_bubbleGame:
12331234
howToPlay: "遊び方"
@@ -1983,8 +1984,7 @@ _2fa:
19831984
alreadyRegistered: "既に設定は完了しています。"
19841985
registerTOTP: "認証アプリの設定を開始"
19851986
step1: "まず、{a}や{b}などの認証アプリをお使いのデバイスにインストールします。"
1986-
step2: "次に、表示されているQRコードをアプリでスキャンします。"
1987-
step2Click: "QRコードをクリックすると、お使いの端末にインストールされている認証アプリやキーリングに登録できます。"
1987+
step2: "次に、表示されているQRコードをアプリでスキャンするか、ボタンをクリックして端末上でアプリを開きます。"
19881988
step2Uri: "デスクトップアプリを使用する場合は次のURIを入力します"
19891989
step3Title: "確認コードを入力"
19901990
step3: "アプリに表示されている確認コード(トークン)を入力します。"

packages/frontend/src/components/MkButton.vue

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
2323
v-else class="_button"
2424
:class="[$style.root, { [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike }]"
2525
:to="to ?? '#'"
26+
:behavior="linkBehavior"
2627
@mousedown="onMousedown"
2728
>
2829
<div ref="ripples" :class="$style.ripples" :data-children-class="$style.ripple"></div>
@@ -43,6 +44,7 @@ const props = defineProps<{
4344
inline?: boolean;
4445
link?: boolean;
4546
to?: string;
47+
linkBehavior?: null | 'window' | 'browser';
4648
autofocus?: boolean;
4749
wait?: boolean;
4850
danger?: boolean;

packages/frontend/src/pages/settings/2fa.qrdialog.vue

+13-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ SPDX-License-Identifier: AGPL-3.0-only
3333
<a href="https://support.google.com/accounts/answer/1066447" rel="noopener" target="_blank" class="_link">Google Authenticator</a>
3434
</template>
3535
</I18n>
36-
<div>{{ i18n.ts._2fa.step2 }}<br>{{ i18n.ts._2fa.step2Click }}</div>
37-
<a :href="twoFactorData.url"><img :class="$style.qr" :src="twoFactorData.qr"></a>
36+
<div>{{ i18n.ts._2fa.step2 }}</div>
37+
<div>
38+
<a :class="$style.qrRoot" :href="twoFactorData.url"><img :class="$style.qr" :src="twoFactorData.qr"></a>
39+
<!-- QRコード側にマージンが入っているので直下でOK -->
40+
<div><MkButton inline rounded link :to="twoFactorData.url" :linkBehavior="'browser'">{{ i18n.ts.launchApp }}</MkButton></div>
41+
</div>
3842
<MkKeyValue :copy="twoFactorData.url">
3943
<template #key>{{ i18n.ts._2fa.step2Uri }}</template>
4044
<template #value>{{ twoFactorData.url }}</template>
@@ -177,8 +181,14 @@ function allDone() {
177181
transform: translateX(-50px);
178182
}
179183

180-
.qr {
184+
.qrRoot {
185+
display: block;
186+
margin: 0 auto;
181187
width: 200px;
182188
max-width: 100%;
183189
}
190+
191+
.qr {
192+
width: 100%;
193+
}
184194
</style>

0 commit comments

Comments
 (0)