Skip to content

Conversation

@hyrious
Copy link
Contributor

@hyrious hyrious commented Jul 31, 2023

cc @netless-io/native

The flow:

  1. User login with wechat, and Flat asks to bind a phone
  2. User hit [send message] from binding phone page, but it throws error about the phone is already registered (SMSAlreadyBinding)
  3. Replace that error with this: ask the user whether to merge this account into that phone, this means all data in this account will be lost
  4. User hit [yes], then take him to the rebind phone page
  5. User hit [send message] from that page, then enter the code to process this action
  6. As a result, this endpoint returns the rebind status and a full payload of login (with jwt token)

Note that these steps cannot be automated in flat server, where "automated" means User hit [send message], then SMSAlreadyBinding, then directly call rebind-phone/send-message, then let him process the rebind without notification. This is because we have no clue about whether an account is newly created or not (whether he has uploaded assets into cloud storage, or created room).

@hyrious hyrious marked this pull request as ready for review July 31, 2023 09:16
@syt-honey
Copy link
Member

cc @netless-io/native

The flow:

  1. User login with wechat, and Flat asks to bind a phone
  2. User hit [send message] from binding phone page, but it throws error about the phone is already registered (SMSAlreadyBinding)
  3. Replace that error with this: ask the user whether to merge this account into that phone, this means all data in this account will be lost
  4. User hit [yes], then take him to the rebind phone page
  5. User hit [send message] from that page, then enter the code to process this action
  6. As a result, this endpoint returns the rebind status and a full payload of login (with jwt token)

Note that these steps cannot be automated in flat server, where "automated" means User hit [send message], then SMSAlreadyBinding, then directly call rebind-phone/send-message, then let him process the rebind without notification. This is because we have no clue about whether an account is newly created or not (whether he has uploaded assets into cloud storage, or created room).

Noted.

@ooeyuna ooeyuna merged commit b99b660 into netless-io:main Aug 3, 2023
@hyrious hyrious deleted the binding-phone branch August 3, 2023 03:19
aderan pushed a commit to aderan/flat-server that referenced this pull request Aug 17, 2023
* feat(v2): add user/rebind-phone{/send-message}

* use safe phone in checking can send code

* update filename

* add unit test
ooeyuna added a commit that referenced this pull request Aug 24, 2023
* chore(ci): remove US deployment (#735)

* feat: add region code (#736)

* add region code for roomUUID and inviteCode

* remove us ci, use CN as default region

* fix test.yaml

* roomUUID not only uuidv4 format

* `region_code`  use `1` as default

---------

Co-authored-by: siyu <chensiyi@agora.io>

* fix(v1): rejoin a deleted room causes incorrect rtc uid (#737)

Co-authored-by: xuyunshi <405029644@qq.com>

* (fix): cancel roomUUID uuid-v4 format limit (#738)

* fix: cancel roomUUID uuid-v4 format limit

* cancel room export users api uuid limit

---------

Co-authored-by: siyu <chensiyi@agora.io>

* fix invite code check (#739)

Co-authored-by: siyu <chensiyi@agora.io>

* refactor(room): set invite code expiration to 100 days (#740)

* feat: add region configs api (#741)

Co-authored-by: siyu <chensiyi@agora.io>
Co-authored-by: hyrious <hyrious@outlook.com>

* feat(v2): add user/rebind-phone{/send-message} (#742)

* feat(v2): add user/rebind-phone{/send-message}

* use safe phone in checking can send code

* update filename

* add unit test

* feat(v2): add register/phone{/send-message} (#743)

feat(v2): add login/phone

feat(v2): add user/password

feat(v2): add reset/phone{/send-password}

add unit test

move mysql.salt to login.salt

* fix: should use full phone string in database (#746)

* chore: deploy sg via ci (for dev) (#747)

* add sg ci

* remove unuse step

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date:      Thu Aug 3 16:22:13 2023 +0800
#
# On branch sa/add_sg_ci
# Changes to be committed:
#	modified:   .gitlab-ci.yml
#

---------

Co-authored-by: siyu <chensiyi@agora.io>

* feat: add email support (#745)

* feat(v2): add email support

feat: add SMTP support

* add ajv email, return email send failed, email length = 100

* return phone send failed

* fix: wrong return value of send message (#749)

* refactor: change all login errors (#748)

* refactor: add {hasPassword: boolean} to login responses (#744)

* refactor: update email templates (#750)

* fix sg deploy (#751)

Co-authored-by: siyu <chensiyi@agora.io>

* refactor: add more fields to region configs (#752)

* refactor: add more fields to region configs

* enforce filename style

* add censorship config

* add config hash

* chore(deploy): add dev sg (#756)

* chore(deploy): add dev sg

* fix: v2 login should return the same structure as v1 (#755)

* refactor: generate different avatars for users (#754)

* refactor: generate different avatars for users

* refactor: update avatar name

---------

Co-authored-by: qianzhu <36325249+syt-honey@users.noreply.github.com>

* refactor: remove region payload, add whiteboard.region config (#753)

* change replicaCount and namespace for dev (#757)

Co-authored-by: siyu <chensiyi@agora.io>

* fix typing issue introduced in 6a91e5c (#758)

* fix helm name conflict (#759)

Co-authored-by: siyu <chensiyi@agora.io>

* fix helm name for dev deploy (#760)

Co-authored-by: siyu <chensiyi@agora.io>

* refactor: rebind-phone use lowercase in status keys (#761)

* fix: rebind phone should only work with existing account (#762)

* refactor(v1): bind email send message support language (#763)

* refactor(v1): bind email send message support language

* refactor: move email template to a single file

* refactor: add binding information in list (#765)

* fix guide pptx (#764)

* fix v2 setGuidePPTX() failed to insert file

* refactor: set only one guide pptx file by convert region

* fix: use correct region

* fix(v1): register binding email routes (#767)

* fix(v1): google use different callbacks to get token (#768)

* fix: cannot use "password" format (#766)

* fix(v1): list binding missing apple field (#769)

* feat(v1): add binding apple api (#770)

* fix(v1): add guide pptx in google register process (#771)

* fix(v1): add router for apple binding (#772)

* fix(v1): apple login find incorrect user (#773)

* refactor(v2): remove password limit (#774)

* force manual when prod deploy (#775)

Co-authored-by: siyu <chensiyi@agora.io>

---------

Co-authored-by: hyrious <hyrious@outlook.com>
Co-authored-by: siyu <chensiyi@agora.io>
Co-authored-by: xuyunshi <405029644@qq.com>
Co-authored-by: flat-bot <81130480+flat-bot@users.noreply.github.com>
Co-authored-by: qianzhu <36325249+syt-honey@users.noreply.github.com>
Co-authored-by: Vince <zjxuyunshi@gmail.com>
hyrious added a commit that referenced this pull request Aug 24, 2023
* feat(v2): add user/rebind-phone{/send-message}

* use safe phone in checking can send code

* update filename

* add unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants