forked from baron/baron-sso
fix: refine error messages for signup failure and company code
This commit is contained in:
@@ -460,7 +460,7 @@ func (h *AuthHandler) Signup(c *fiber.Ctx) error {
|
|||||||
} else {
|
} else {
|
||||||
// If companyCode provided but not found, we should probably reject if we want strictness,
|
// If companyCode provided but not found, we should probably reject if we want strictness,
|
||||||
// or just treat as GENERAL user. Given the risk "존재하지 않는 테넌트도 저장됨", we should reject.
|
// or just treat as GENERAL user. Given the risk "존재하지 않는 테넌트도 저장됨", we should reject.
|
||||||
return errorJSON(c, fiber.StatusBadRequest, "Invalid company code.")
|
return errorJSON(c, fiber.StatusBadRequest, "해당하는 가족사(테넌트)를 찾을 수 없습니다.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -328,19 +328,19 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
String eStr = e.toString().toLowerCase();
|
String eStr = e.toString().toLowerCase();
|
||||||
setState(() {
|
setState(() {
|
||||||
if (eStr.contains('uppercase')) {
|
if (eStr.contains('password') && eStr.contains('uppercase')) {
|
||||||
_passwordError = tr(
|
_passwordError = tr(
|
||||||
'msg.userfront.signup.password.uppercase_required',
|
'msg.userfront.signup.password.uppercase_required',
|
||||||
);
|
);
|
||||||
} else if (eStr.contains('lowercase')) {
|
} else if (eStr.contains('password') && eStr.contains('lowercase')) {
|
||||||
_passwordError = tr(
|
_passwordError = tr(
|
||||||
'msg.userfront.signup.password.lowercase_required',
|
'msg.userfront.signup.password.lowercase_required',
|
||||||
);
|
);
|
||||||
} else if (eStr.contains('digit') || eStr.contains('number')) {
|
} else if (eStr.contains('password') && (eStr.contains('digit') || eStr.contains('number'))) {
|
||||||
_passwordError = tr('msg.userfront.signup.password.number_required');
|
_passwordError = tr('msg.userfront.signup.password.number_required');
|
||||||
} else if (eStr.contains('symbol') || eStr.contains('special')) {
|
} else if (eStr.contains('password') && (eStr.contains('symbol') || eStr.contains('special'))) {
|
||||||
_passwordError = tr('msg.userfront.signup.password.symbol_required');
|
_passwordError = tr('msg.userfront.signup.password.symbol_required');
|
||||||
} else if (eStr.contains('length') || eStr.contains('12 characters')) {
|
} else if (eStr.contains('password') && (eStr.contains('length') || eStr.contains('12 characters'))) {
|
||||||
_passwordError = tr('msg.userfront.signup.password.length_required');
|
_passwordError = tr('msg.userfront.signup.password.length_required');
|
||||||
} else {
|
} else {
|
||||||
_passwordError = tr(
|
_passwordError = tr(
|
||||||
|
|||||||
Reference in New Issue
Block a user