Verification
Add or change the account's email and phone number and confirm each with a
one-time code. The phone code can be delivered by SMS or by a messenger bot
listed with mysabay_chatbot_listChatBotByUser.
All requests go to the gateway and need the authentication headers.
Email flow
As the UI implements it (verify-email-dialog.tsx, email-step.tsx,
otp-step.tsx):
- The user enters an email. If the current email is already verified, the same address is rejected client-side ("This is already your email"); an unverified address may be resubmitted to get it verified.
sso_updateProfileEmail(email)sends a one-time code to that address. A truthy result moves the dialog to the code step.- The user types the 6-digit code; on the 6th digit the UI calls
sso_verifyProfileEmail(verificationCode)with the code converted to a number (Int!). On success the dialog closes and the profile is re-read. - "Resend code" calls
sso_updateProfileEmailagain with the same email; it is enabled after a 10-second countdown. No captcha is used for email.
Phone flow
As the UI implements it (verify-phone-dialog.tsx, phone-step.tsx,
otp-step.tsx, security-overview.tsx):
- The phone step shows a phone field and a Provider select. The options
are
SMS(always offered first, added by the UI) plus the messengers returned bymysabay_chatbot_listChatBotByUser(upper-casedprovider, e.g.TELEGRAM). For Telegram the UI shows steps: start a chat with the bot (link frommetadata.bot_url, name frombotName), share your phone number in the chat, receive the OTP in Telegram, enter it. - The provider must be a
sso_PhoneVerificationProvidervalue (SMS,TELEGRAM,MAIL,WHATSAPP,LINE); otherwise the UI refuses to send. - On submit the UI runs an invisible Google reCAPTCHA (
executeAsync(), site keyConstants.reCaptchaKey/RUNTIME_RECAPTCHA_KEY) and sends the phone as digits without the leading+:- No verified phone yet (adding, or verifying an unverified number):
sso_addProfilePhone(phone, reCaptchaToken, provider). - A verified phone exists (changing it):
sso_updateProfilePhoneCaptcha(phone, securityPassword, reCaptchaToken, provider); the user must also enter the security password.
- No verified phone yet (adding, or verifying an unverified number):
- A truthy result moves to the code step. On the 6th digit the UI calls
sso_verifyProfilePhone(verificationCode)with the code as a string (keeps leading zeros). On success the dialog closes and the profile is re-read. - "Resend code" repeats step 3 (new captcha token, same provider and security password) after a 10-second countdown. The captcha is reset after every attempt.
Update Profile Email
Mutation · sso_updateProfileEmail
Adds or changes the email and sends a one-time verification code to it (step 2 of the email flow). It is also called again for "Resend code".
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
email | String! | Yes | The email address (trimmed and validated as an email by the form). |
Variables
{
"email": "user@example.com"
}
Request
mutation Sso_updateProfileEmail($email: String!) {
sso_updateProfileEmail(email: $email)
}
Response
Generated from the schema; values show field types.
{
"data": {
"sso_updateProfileEmail": "String!"
}
}
Verify Profile Email
Mutation · sso_verifyProfileEmail
Confirms the email with the code sent by
sso_updateProfileEmail.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
verificationCode | Int! | Yes | The 6-digit code. The UI converts the typed code with Number(), so a code with leading zeros loses them. |
Variables
{
"verificationCode": 123456
}
Request
mutation Sso_verifyProfileEmail($verificationCode: Int!) {
sso_verifyProfileEmail(verificationCode: $verificationCode)
}
Response
Generated from the schema; values show field types.
{
"data": {
"sso_verifyProfileEmail": "String!"
}
}
List Chat Bots by User
Query · mysabay_chatbot_listChatBotByUser
Lists the messenger bots (for example Telegram) that can deliver the phone
verification code. The phone step uses the result to fill the Provider select
(after the built-in SMS option) and to show the bot's name and link. It runs
with fetchPolicy: "cache-and-network" and pager: { page: 1, limit: 10 }
whenever the phone step is shown.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
pager | mysabay_chatbot_PagerInput | No | Sent by the UI. |
filter | mysabay_chatbot_UserChatBotFilterInput | No | Not sent by the UI. |
pager
| Field | Type | Required | Description |
|---|---|---|---|
page | Int! | Yes | |
limit | Int! | Yes |
filter
| Field | Type | Required | Description |
|---|---|---|---|
id | mysabay_chatbot_MongoObjectIdFilter | No | eq / ne (ID), in / nin ([ID!]) |
provider | mysabay_chatbot_MongoProviderEnumFilter | No | eq / ne / in / nin over mysabay_chatbot_Provider: TELEGRAM | WHATS_APP | LINE |
type | mysabay_chatbot_MongoChatBotTypeEnumFilter | No | eq / ne / in / nin over mysabay_chatbot_ChatBotType: VERIFICATION | ANY |
botName | mysabay_chatbot_MongoStringFilter | No | eq / ne (String), in / nin ([String!]) |
Variables
{
"pager": {
"page": 1,
"limit": 10
}
}
Request
query Mysabay_chatbot_listChatBotByUser($pager: mysabay_chatbot_PagerInput) {
mysabay_chatbot_listChatBotByUser(pager: $pager) {
chatBots {
id
serviceCode
provider
botName
type
status
metadata
}
pagination {
currentPage
lastPage
from
perPage
to
total
}
}
}
Response
Generated from the schema; values show field types. The metadata keys are the
ones the app's TypeScript type reads; the schema types metadata as
mysabay_chatbot_JSON.
{
"data": {
"mysabay_chatbot_listChatBotByUser": {
"chatBots": [
{
"id": "ID!",
"serviceCode": "String!",
"provider": "String!",
"botName": "String!",
"type": "String!",
"status": "Int!",
"metadata": {
"bot_url": "String",
"homepage_url": "String",
"settings_url": "String",
"share_contact_label": "String",
"account_settings_label": "String"
}
}
],
"pagination": {
"currentPage": "Int!",
"lastPage": "Int!",
"from": "Int!",
"perPage": "Int!",
"to": "Int!",
"total": "Int!"
}
}
}
}
The chatbot service's provider enum spells WhatsApp WHATS_APP, while
sso_PhoneVerificationProvider uses WHATSAPP. The UI upper-cases provider
and sends it as is, so a WhatsApp bot returned as WHATS_APP would be refused
by the UI's provider check. Only Telegram has verification instructions in the
UI.
Add Profile Phone
Mutation · sso_addProfilePhone
Adds a phone number, or re-sends a code for an unverified one, and delivers a one-time code through the chosen provider (step 3 of the phone flow).
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
phone | String! | Yes | The number with country code, digits only (the UI strips the leading + and spaces). |
reCaptchaToken | String! | Yes | Token from the invisible reCAPTCHA (executeAsync()). |
provider | sso_PhoneVerificationProvider! | Yes | SMS | TELEGRAM | MAIL | WHATSAPP | LINE |
checkPhoneVerification | Boolean | No | Not sent by the UI; its effect is not documented in the schema. |
Variables
{
"phone": "85512345678",
"reCaptchaToken": "<RECAPTCHA_TOKEN>",
"provider": "TELEGRAM"
}
Request
mutation Sso_addProfilePhone($phone: String!, $reCaptchaToken: String!, $provider: sso_PhoneVerificationProvider!) {
sso_addProfilePhone(
phone: $phone
reCaptchaToken: $reCaptchaToken
provider: $provider
)
}
Response
Generated from the schema; values show field types.
{
"data": {
"sso_addProfilePhone": "String!"
}
}
Update Profile Phone (Captcha)
Mutation · sso_updateProfilePhoneCaptcha
Replaces an already verified phone number and sends a one-time code to the new one. It needs the security password.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
phone | String! | Yes | The new number with country code, digits only. |
securityPassword | String! | Yes | The account's security password (see Add Security Password if none is set). |
reCaptchaToken | String! | Yes | Token from the invisible reCAPTCHA. |
provider | sso_PhoneVerificationProvider! | Yes | SMS | TELEGRAM | MAIL | WHATSAPP | LINE |
checkPhoneVerification | Boolean | No | Not sent by the UI. |
Variables
{
"phone": "85512345678",
"securityPassword": "<SECURITY_PASSWORD>",
"reCaptchaToken": "<RECAPTCHA_TOKEN>",
"provider": "SMS"
}
Request
mutation Sso_updateProfilePhoneCaptcha($phone: String!, $securityPassword: String!, $reCaptchaToken: String!, $provider: sso_PhoneVerificationProvider!) {
sso_updateProfilePhoneCaptcha(
phone: $phone
securityPassword: $securityPassword
reCaptchaToken: $reCaptchaToken
provider: $provider
)
}
Response
Generated from the schema; values show field types.
{
"data": {
"sso_updateProfilePhoneCaptcha": "String!"
}
}
Verify Profile Phone
Mutation · sso_verifyProfilePhone
Confirms the phone number with the code sent by
sso_addProfilePhone or
sso_updateProfilePhoneCaptcha.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
verificationCode | String! | Yes | The 6-digit code, sent as a string (trimmed) so leading zeros are kept. |
Variables
{
"verificationCode": "012345"
}
Request
mutation Sso_verifyProfilePhone($verificationCode: String!) {
sso_verifyProfilePhone(verificationCode: $verificationCode)
}
Response
Generated from the schema; values show field types.
{
"data": {
"sso_verifyProfilePhone": "String!"
}
}