Show correct err msg when verification code has expired

This commit is contained in:
Neeraj Gupta 2021-09-04 16:16:02 +05:30
parent 56bcf32b95
commit 6dc6501381
2 changed files with 3 additions and 0 deletions

View file

@ -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}`);
} }

View file

@ -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',