-
Notifications
You must be signed in to change notification settings - Fork 210
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
feat(phone): Add creat methods for recovery phone lib #17979
Conversation
3485ddb
to
287b482
Compare
|
||
import { BaseError } from '@fxa/shared/error'; | ||
|
||
export class RecoveryPhoneError extends BaseError { |
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.
Nice!
}); | ||
|
||
afterEach(async () => { | ||
await db.destroy(); |
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.
Do we need to create and destroy the db after each test, or can we just do this once for the test suite.
|
||
const uidBuffer = Buffer.from(uid, 'hex'); | ||
|
||
// TODO: Perform phone number validation here via https://www.twilio.com/docs/lookup/v2-api#making-a-request |
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.
Is there a follow up for this?
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.
phoneNumber: string; | ||
createdAt: number; | ||
lastConfirmed: number; | ||
lookupData: string; |
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.
What is lookup data?
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.
Looks like it stores information if the phone number is fradulent or active and can recieve message.
lookupData JSON, | ||
PRIMARY KEY (uid), | ||
INDEX idx_phoneNumber (phoneNumber), | ||
FOREIGN KEY (uid) REFERENCES accounts(uid) ON DELETE CASCADE |
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.
Nice
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.
Looks good to me!
Because
This pull request
Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-10341
Closes: https://mozilla-hub.atlassian.net/browse/FXA-10330
Checklist
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Any other information that is important to this pull request.