Verify a phone or email after an admin change
Support steps for a user whose phone or email a platform admin changed. What the user sees, what support tells the user, and when the admin sends a code.
Audience: Kulcare support and platform admins who use the admin app (kulcare-admin).
TL;DR: When an admin changes a practitioner's phone or a user's email, the new phone or email is unverified. The user verifies a new phone at sign-in: Kulcare sends a code to the new number, and the user enters it. Usually the admin does not send a code. The user verifies a new email in Connect, on My profile, with a code that Kulcare sends to that email.
Status: this page applies after PR #2648 and PR #2636 merge. The link to the flow map section works after PR #2648 merges.
Source: PR #2648 (the phone, and the reset of verification on an admin change) and PR #2636 (the email verification on My profile). For the API and the token details, see After an admin changes the phone in the authentication flow map.
What an admin change does
The user never proved a phone or an email that an admin types. So the change makes it unverified.
| Change | Where the admin does it | Result |
|---|---|---|
| Practitioner phone | Practitioners > the practitioner > Basic Details > Edit > Phone Number | The new number is unverified. A code that went to the old number is no longer valid. |
| Practitioner email | The same Edit Doctor Details dialog > Email | The new address is unverified. |
| User email | Users > the user > Edit (dialog Edit User) > Email | The new address is unverified. |
Some edits are not a change, and the verification stays:
- A phone typed in a different format: with a
+at the start, or with the country code in front. Kulcare stores+919876500000and919876500000as9876500000. - An email that differs only in upper and lower case.
The admin cannot change the country code, and the admin can change the phone of a practitioner only. The Users page cannot change a phone. After the country code is removed, the number must have 10 to 15 digits. If it does not, the save fails and nothing changes.
An unverified phone or email has two effects:
- Invites. An invite finds a user only by a verified phone or a verified email. An invite sent to the new phone or email does not show on the user's invites page until the user verifies it. An invite that Kulcare already linked to the user's account is not affected.
- Phone sign-in. Sign-in with the new phone and the password asks for a code before it continues.
Help a user verify a new phone
Tell the user to do these steps:
- Open the Kulcare sign-in page.
- Sign in with the new phone number and the usual password.
- On Verify your phone, enter the 6-digit code from the SMS. Kulcare sends the code when the page opens.
- If no SMS comes, wait until the Resend in countdown ends, then select Resend code.
- On the sign-in page, sign in again with the phone and the password.
What the user sees:
- After step 2, a message: "Please verify your phone number to continue." Then the Verify your phone page opens.
- After step 3, the sign-in page opens again with the message "Your number is verified. Sign in to finish." This is correct for a user who signed in before. The code proves the phone only, so the user must sign in again. A user with two-factor authentication also enters the second factor.
- The sign-in form does not fill in the phone number. The user types it again.
- After step 5, the user is in Kulcare. Invites sent to the new phone now show on the invites page.
If the user does not know the password, the user selects Forgot password? on the sign-in page and resets it first. Then the user starts at step 1.
When the admin sends a code
The admin app has no button for this. A platform admin sends the code through the API:
POST /identity/admin/practitioners/:id/phone_verification. The code goes by SMS to the
practitioner's current phone. It is the same code as Resend code sends, and the user enters it on the same
Verify your phone page.
Each new code replaces the previous code. The Verify your phone page sends a code when it opens, so a code that the admin sent before the user signs in is no longer valid. Send an admin code only when:
- The user is already on Verify your phone, and
- No SMS came, and Resend code does not help. For example, Kulcare blocks Resend code after too many tries from the same network.
Then tell the user to stay on the page and enter the new code. Do not sign in again, because that sends another code.
The API refuses a send in these cases:
| Response | Cause | What to do |
|---|---|---|
PHONE_ALREADY_VERIFIED | The user already verified the phone. | Tell the user to sign in. |
NO_PHONE | The practitioner has no linked account, or no phone. | Add the phone first. |
OTP_NOT_SENT | The SMS did not go out, or Kulcare could not store the code. | Send again after one minute. |
| 429 | More than 5 sends for this practitioner in 5 minutes. | Wait 5 minutes. |
Problems the user can tell you about
| The user says | Cause | What to do |
|---|---|---|
| "Your account has been deactivated. Please contact support." at sign-in | The account is deactivated. Sign-in stops before it asks for a code, and a code does not activate the account. | An admin activates the account first. Then the user starts again at step 1. |
| "phone_number is already being used" at sign-up | The user tried to make a new account with the new phone. | Tell the user to sign in, not sign up. |
| "This account is already verified. Please sign in." | The phone is already verified. | Tell the user to sign in. |
| "We could not send the code. Try Resend." | The SMS did not go out. | Wait 30 seconds, then select Resend code. |
Help a user with a new email
The Verify your phone page cannot verify an email: Kulcare sends that code by SMS only. The user verifies an email in Connect. Tell the user to do these steps:
- Sign in to Kulcare with the phone number and the password.
- Open My profile.
- Find Sign-in email. A vendor finds it in Identity. Other users find it in Your account. An email that is not verified shows Unverified, and Verify your email shows under it.
- Select Send code. Kulcare sends a code to that email.
- Enter the code in Code, then select Verify.
What the user sees:
- After step 4: "We sent a code to" and the email address.
- After step 5: "Your email is verified". The Unverified tag changes to Verified. Invites sent to that email now show on the invites page.
- If no email comes, the user waits for the countdown, then selects Send a new code.
| The user sees | Cause | What to do |
|---|---|---|
| "That code is wrong. Check it and try again." | The code does not match. | Check the latest email. |
| "That code has expired. Send a new code." | The code is more than 10 minutes old. | Select Send a new code. |
| "Too many wrong codes. Send a new code." | Five wrong tries of one code. | Select Send a new code. |
| "Too many tries. Wait a few minutes, then try again." | Too many sends or checks in a short time. | Wait 10 minutes. After 20 sends or 30 checks in one day, wait up to 24 hours. |
| "Your email is already verified" | The email is already verified. | No action. |
The user can also change the email to a different address: Sign-in email > Change email. Kulcare sends a code to the new address, and the new address is verified when the user enters it.
Related
- Authentication flow map: every sign-in path, with the API calls.