diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-10-03 18:18:00 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-03 18:18:00 +0900 |
| commit | 2c1a7470d35cb840950e63008fb4014e5e341dd6 (patch) | |
| tree | 54885d1453a2ae5d57bd500d7a6573630d6b3447 /packages/frontend/src | |
| parent | Update CHANGELOG.md (diff) | |
| download | misskey-2c1a7470d35cb840950e63008fb4014e5e341dd6.tar.gz misskey-2c1a7470d35cb840950e63008fb4014e5e341dd6.tar.bz2 misskey-2c1a7470d35cb840950e63008fb4014e5e341dd6.zip | |
feat: サーバー初期設定時に初期パスワードを要求できるように (#14626)
* feat: サーバー初期設定時専用の初期パスワードを設定できるように
* 無いのに入力された場合もエラーにする
* :art:
* :art:
* cypress-devcontainerにもpassを設定(テストが失敗するため)
* [ci skip] :art:
* :v:
* test: please revert this commit before merge
* Revert "test: please revert this commit before merge"
This reverts commit 66b2b48f66830d2450d8cda03955c143feba76c7.
* Update locales/ja-JP.yml
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
* build assets
* Update Changelog
* fix condition
* fix condition
* add comment
* change error code
* 他のエラーコードと合わせる
* Update CHANGELOG.md
---------
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src')
| -rw-r--r-- | packages/frontend/src/pages/welcome.setup.vue | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/packages/frontend/src/pages/welcome.setup.vue b/packages/frontend/src/pages/welcome.setup.vue index a227c7c4bc..cb20cfc5fc 100644 --- a/packages/frontend/src/pages/welcome.setup.vue +++ b/packages/frontend/src/pages/welcome.setup.vue @@ -14,6 +14,10 @@ SPDX-License-Identifier: AGPL-3.0-only </div> <div class="_gaps_m" style="padding: 32px;"> <div>{{ i18n.ts.intro }}</div> + <MkInput v-model="initialPassword" type="password" data-cy-admin-initial-password> + <template #label>{{ i18n.ts.initialPasswordForSetup }} <div v-tooltip:dialog="i18n.ts.initialPasswordForSetupDescription" class="_button _help"><i class="ti ti-help-circle"></i></div></template> + <template #prefix><i class="ti ti-lock"></i></template> + </MkInput> <MkInput v-model="username" pattern="^[a-zA-Z0-9_]{1,20}$" :spellcheck="false" required data-cy-admin-username> <template #label>{{ i18n.ts.username }}</template> <template #prefix>@</template> @@ -47,6 +51,7 @@ import MkAnimBg from '@/components/MkAnimBg.vue'; const username = ref(''); const password = ref(''); +const initialPassword = ref(''); const submitting = ref(false); function submit() { @@ -56,14 +61,27 @@ function submit() { misskeyApi('admin/accounts/create', { username: username.value, password: password.value, + initialPassword: initialPassword.value === '' ? null : initialPassword.value, }).then(res => { return login(res.token); - }).catch(() => { + }).catch((err) => { submitting.value = false; + let title = i18n.ts.somethingHappened; + let text = err.message + '\n' + err.id; + + if (err.code === 'ACCESS_DENIED') { + title = i18n.ts.permissionDeniedError; + text = i18n.ts.operationForbidden; + } else if (err.code === 'INCORRECT_INITIAL_PASSWORD') { + title = i18n.ts.permissionDeniedError; + text = i18n.ts.incorrectPassword; + } + os.alert({ type: 'error', - text: i18n.ts.somethingHappened, + title, + text, }); }); } @@ -74,8 +92,8 @@ function submit() { min-height: 100svh; padding: 32px 32px 64px 32px; box-sizing: border-box; -display: grid; -place-content: center; + display: grid; + place-content: center; } .form { |