Phone number verification in account creation (#2564)
* Add optional sms verification * Add support link to account creation * Add e2e tests * Bump api@0.9.0 * Update lockfile * Bump api@0.9.1 * Include the phone number in the ui * Add phone number validation and normalization
This commit is contained in:
parent
89f4105082
commit
95f70a9a6a
17 changed files with 701 additions and 339 deletions
|
@ -44,6 +44,8 @@ export type ApiContext = {
|
|||
password: string
|
||||
handle: string
|
||||
inviteCode?: string
|
||||
verificationPhone?: string
|
||||
verificationCode?: string
|
||||
}) => Promise<void>
|
||||
login: (props: {
|
||||
service: string
|
||||
|
@ -203,7 +205,15 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||
}, [setStateAndPersist, queryClient])
|
||||
|
||||
const createAccount = React.useCallback<ApiContext['createAccount']>(
|
||||
async ({service, email, password, handle, inviteCode}: any) => {
|
||||
async ({
|
||||
service,
|
||||
email,
|
||||
password,
|
||||
handle,
|
||||
inviteCode,
|
||||
verificationPhone,
|
||||
verificationCode,
|
||||
}: any) => {
|
||||
logger.info(`session: creating account`, {
|
||||
service,
|
||||
handle,
|
||||
|
@ -217,6 +227,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||
password,
|
||||
email,
|
||||
inviteCode,
|
||||
verificationPhone,
|
||||
verificationCode,
|
||||
})
|
||||
|
||||
if (!agent.session) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue