-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imprv: Behavior when creating first user fails #8801
imprv: Behavior when creating first user fails #8801
Conversation
@@ -27,11 +27,17 @@ module.exports = (crowi: Crowi): Router => { | |||
const router = express.Router(); | |||
|
|||
// eslint-disable-next-line max-len | |||
router.post('/', registerRules(), apiV3FormValidator, addActivity, async(req: FormRequest, res: ApiV3Response) => { | |||
router.post('/', registerRules(), registerValidation, addActivity, async(req: FormRequest, res: ApiV3Response) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apiV3FormValidator middleware ではなく registerRules() に対応する registerValidation middleware を利用するように変更。
if (!req.form.isValid) { | ||
const errors = req.form.errors; | ||
return res.apiv3Err(errors, 400); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/register にならって追記。Validation に失敗したらここでエラーを返却する。
growi/apps/app/src/server/routes/login.js
Lines 137 to 140 in d92b768
if (!req.form.isValid) { | |
const errors = req.form.errors; | |
return res.apiv3Err(errors, 400); | |
} |
))} | ||
</p> | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoginForm.tsx にならってサーバーからのエラー結果を form 上部のアラートに表示するようにした
growi/apps/app/src/components/LoginForm/LoginForm.tsx
Lines 356 to 366 in d92b768
{ | |
registerErrors != null && registerErrors.length > 0 && ( | |
<p className="alert alert-danger"> | |
{registerErrors.map(err => ( | |
<span> | |
{t(err.message)}<br /> | |
</span> | |
))} | |
</p> | |
) | |
} |
reg-suit detected visual differences. Check this report, and review them. 🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴🔴 ⚫⚫⚫⚫⚫⚫⚫⚫⚫ What do the circles mean?The number of circles represent the number of changed images.🔴 : Changed items, ⚪ : New items, ⚫ : Deleted items, and 🔵 Passed items How can I change the check status?If reviewers approve this PR, the reg context status will be green automatically. |
Task
#146003 [v7] [issue] 最初のユーザーを作成する時に8文字以内のパスワードで登録しようとすると「インストールに失敗しました...」というトースターのみが表示される
┗ #146005 修正
Demo
2024-05-13.16.37.12.mov