-
Notifications
You must be signed in to change notification settings - Fork 1.7k
verification: don't request a code twice #4221
Conversation
export const hasReceivedCode = (email, address, isTestnet = false) => { | ||
const port = isTestnet ? 28443 : 18443; | ||
const query = stringify({ email, address }); | ||
return fetch(`https://email-verification.parity.io:${port}/?` + query, { |
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.
- Blank line before
- Why are we using template strings & ES6-style string +'s in one?
export const hasReceivedCode = (number, address, isTestnet = false) => { | ||
const port = isTestnet ? 8443 : 443; | ||
const query = stringify({ number, address }); | ||
return fetch(`https://sms-verification.parity.io:${port}/?` + query, { |
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.
As per above comments.
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.
Copied from above, will change. Although I disagree 😁
@@ -21,7 +21,7 @@ import SMSVerificationABI from '~/contracts/abi/sms-verification.json'; | |||
import VerificationStore, { | |||
LOADING, QUERY_DATA, QUERY_CODE, POSTED_CONFIRMATION, DONE | |||
} from './store'; | |||
import { isServerRunning, postToServer } from '../../3rdparty/sms-verification'; | |||
import { isServerRunning, hasReceivedCode, postToServer } from '../../3rdparty/sms-verification'; |
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.
Since we are touching the line, always prefer ~/3rdparty
to ../../3rdparty
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.
You're right. Just adapted it without paying attention.
const port = isTestnet ? 28443 : 18443; | ||
const query = stringify({ email, address }); | ||
return fetch(`https://email-verification.parity.io:${port}/?` + query, { | ||
mode: 'cors', cache: 'no-store' |
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.
Prefer multi-key objects to have a single entry per line.
Better UX for the verification process. Users haven't been able to close the verification modal/page as soon as they had requested a code.