Show correct err msg when verification code has expired
This commit is contained in:
parent
56bcf32b95
commit
6dc6501381
|
@ -109,6 +109,8 @@ export default function Verify() {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e?.status === 401) {
|
if (e?.status === 401) {
|
||||||
setFieldError('ott', constants.INVALID_CODE);
|
setFieldError('ott', constants.INVALID_CODE);
|
||||||
|
} else if (e?.status === 410) {
|
||||||
|
setFieldError('ott', constants.EXPIRED_CODE);
|
||||||
} else {
|
} else {
|
||||||
setFieldError('ott', `${constants.UNKNOWN_ERROR} ${e.message}`);
|
setFieldError('ott', `${constants.UNKNOWN_ERROR} ${e.message}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ const englishConstants = {
|
||||||
VERIFY: 'verify',
|
VERIFY: 'verify',
|
||||||
UNKNOWN_ERROR: 'something went wrong, please try again',
|
UNKNOWN_ERROR: 'something went wrong, please try again',
|
||||||
INVALID_CODE: 'invalid verification code',
|
INVALID_CODE: 'invalid verification code',
|
||||||
|
EXPIRED_CODE: 'your verification code has expired',
|
||||||
SENDING: 'sending...',
|
SENDING: 'sending...',
|
||||||
SENT: 'sent!',
|
SENT: 'sent!',
|
||||||
PASSWORD: 'password',
|
PASSWORD: 'password',
|
||||||
|
|
Loading…
Reference in a new issue