micro7duylong / ComeBack-Seed

project ComeBack which integrate with OnePos
1 stars 0 forks source link

Feature: Sign In with Phone Number #8

Open micro7duylong opened 1 year ago

micro7duylong commented 1 year ago

Feature: Sign In with Phone Number @authentication @phone @visitor @signin As a user of ComeBack App, named Bruce Bruce want to be able to sign in using my phone number, So that Bruce can easily and securely access the app without having to remember a username or password.

feature extend: Verify Phone Number with OTP

Note: This user story assumes that the app offers the option to sign in using a phone number as an alternative to using a username and password. This feature provides a quick and convenient way to access the app, particularly for users who may have difficulty remembering login credentials. The app can also use this feature to send verification codes to the user's phone number to ensure secure login and protect the user's account information.

micro7duylong commented 1 year ago

Example, Concrete example:

  1. The sign-in screen includes one fields: phone number and an option to sign in with a phone number, GG sign in and FB sign in:

    1.1 Login with phone number form is not showing up: 1.2. Login Button not working properly (disabled/enable When Visitor types invalid/valid Phone number ,.) 1.3. The Visitor is prompted to enter their phone number and receive a verification code via SMS.

  2. Visitor submits invalid form:

    2.1 get message error correctly when submits invalid form. 2.2 get message error correctly when submits invalid form but still be navigate to OTP verification. 2.3 submits invalid form but message error is not correctly.

  3. Visitor enter a valid phone number, which is not associated with an existing account

    3.1 the visitor is prompted a option to create a new account at Sign Up page. 3.2 visitor press at link but not be navigated to Sign Up page. 3.3 the visitor is not prompted any option.

  4. Visitor enter a valid phone number which associated with an existing account

    4.1 phone number associated with an existing account then navigate user to OTP verification 4.2 phone number associated with an existing account but system is not navigate user to OTP verification.

5.̶ ̶T̶̶h̶̶e̶ ̶r̶̶e̶̶g̶̶i̶̶o̶̶n̶ ̶p̶̶h̶̶o̶̶n̶̶e̶ ̶n̶̶u̶̶m̶̶b̶̶e̶̶r̶ ̶i̶̶s̶ ̶n̶̶o̶̶t̶ ̶s̶̶u̶̶p̶̶p̶̶o̶̶r̶̶t̶ ̶

5.̶̶1̶ ̶T̶̶h̶̶e̶ ̶V̶̶i̶̶s̶̶i̶̶t̶̶o̶̶r̶ ̶i̶̶s̶ ̶p̶̶r̶̶o̶̶m̶̶p̶̶t̶̶e̶̶d̶ ̶t̶̶h̶̶e̶ ̶r̶̶e̶̶g̶̶i̶̶o̶̶n̶ ̶p̶̶h̶̶o̶̶n̶̶e̶ ̶n̶̶u̶̶m̶̶b̶̶e̶̶r̶ ̶i̶̶s̶ ̶n̶̶o̶̶t̶ ̶s̶̶u̶̶p̶̶p̶̶o̶̶r̶̶t̶̶.̶ ̶ 5.̶̶2̶ ̶V̶̶i̶̶s̶̶i̶̶t̶̶o̶̶r̶ ̶i̶̶s̶ ̶p̶̶r̶̶o̶̶m̶̶p̶̶t̶̶e̶̶d̶ ̶a̶̶n̶ ̶a̶̶n̶̶o̶̶t̶̶h̶̶e̶̶r̶ ̶o̶̶p̶̶t̶̶i̶̶o̶̶n̶ ̶t̶̶o̶ ̶s̶̶i̶̶g̶̶n̶ ̶i̶̶n̶̶.̶ ̶ 5.̶̶3̶ ̶V̶̶i̶̶s̶̶i̶̶t̶̶o̶̶r̶ ̶i̶̶s̶ ̶n̶̶o̶̶t̶ ̶p̶̶r̶̶o̶̶m̶̶p̶̶t̶̶e̶̶d̶ ̶a̶̶n̶ ̶a̶̶n̶̶o̶̶t̶̶h̶̶e̶̶r̶ ̶o̶̶p̶̶t̶̶i̶̶o̶̶n̶ ̶t̶̶o̶ ̶s̶̶i̶̶g̶̶n̶ ̶i̶̶n̶̶.̶

  1. T̶̶h̶̶e̶ ̶u̶̶s̶̶e̶̶r̶ ̶c̶̶a̶̶n̶ ̶a̶̶l̶̶s̶̶o̶ ̶c̶̶h̶̶o̶̶o̶̶s̶̶e̶ ̶t̶̶o̶ ̶l̶̶i̶̶n̶̶k̶ ̶t̶̶h̶̶e̶̶i̶̶r̶ ̶p̶̶h̶̶o̶̶n̶̶e̶ ̶n̶̶u̶̶m̶̶b̶̶e̶̶r̶ ̶t̶̶o̶ ̶a̶̶n̶ ̶e̶̶x̶̶i̶̶s̶̶t̶̶i̶̶n̶̶g̶ ̶a̶̶c̶̶c̶̶o̶̶u̶̶n̶̶t̶ ̶i̶̶f̶ ̶t̶̶h̶̶e̶̶y̶ ̶a̶̶l̶̶r̶̶e̶̶a̶̶d̶̶y̶ ̶h̶̶a̶̶v̶̶e̶ ̶o̶̶n̶̶e̶̶.̶
  2. T̶̶h̶̶e̶ ̶p̶̶h̶̶o̶̶n̶̶e̶ ̶n̶̶u̶̶m̶̶b̶̶e̶̶r̶ ̶i̶̶s̶ ̶s̶̶a̶̶v̶̶e̶̶d̶ ̶s̶̶e̶̶c̶̶u̶̶r̶̶e̶̶l̶̶y̶ ̶a̶̶n̶̶d̶ ̶c̶̶a̶̶n̶ ̶b̶̶e̶ ̶u̶̶s̶̶e̶̶d̶ ̶f̶̶o̶̶r̶ ̶f̶̶u̶̶t̶̶u̶̶r̶̶e̶ ̶s̶̶i̶̶g̶̶n̶̶i̶̶n̶̶s̶̶.̶
micro7duylong commented 1 year ago

mô tả bối cảnh có thể xảy ra:

  1. Visitor submit phone number is not associated with an existing account, but the user is not prompted to create a new account.

    concrete example

    • Visitor enter valid, invalid phone number
    • Visitor network is not working poverty
    • The system is is not working poverty
    • the request signup is not allowed
    • Visitor enter an phone number that is not associated with an existing account but system still navigate to OTP page
micro7duylong commented 1 year ago

technical specification

@authentication @signin @phone @visitor As a user of ComeBack App, named Bruce Bruce want to be able to sign in using my phone number, So that Bruce can easily and securely access the app without having to remember a username or password.

Scenarios:

@authentication @signin @phonenumber #@visitor

Background: Given The system is working properly And Bruce is on the sign in screen

Scenario: 1. Phone number is associated with an existing account When Bruce enter valid but Phone number is associated with an existing account And Bruce click on the "Sign In" button Then the system suggest Bruce to go to the registration page

Scenario: 2. Phone number is not associated with an existing account When Bruce enter valid Phone number which is associated with an existing account And Bruce click on the "Sign In" button Then the system navigate Bruce to go to the verification OTP page

Scenario Outline: Bruce types invalid or valid phone number. When Visitor types the phone number field with. Then System expect to be navigate Bruce to go to the verification OTP page. Examples:

    | value | result |
    | " " | "invalid " |
    | "012345678a" | "invalid " |
    | "03793186" | "invalid " |
    | "+841234567" | "invalid " |
    | "0123456789" | "valid" |
    | "+84123456789" | "valid" |
micro7duylong commented 1 year ago

APIs Contract

Request: POST/PhonenumberSignIn

Headers:

{ "Content-Type": "application/json" } Body: { "phone_number": "string", }

Response

Success

Status Code: 200 Headers: { "Content-Type": "application/json" } Body: { "id": "string", "name": "string", "phone_number": "string", "access_token": "string" } Error Headers: { "Content-Type": "application/json" } Status Code: 400 Body: { "error": "invalid_request", "error_description": "The request is missing a required parameter, includes an unsupported parameter or parameter value, or is otherwise malformed." } Status Code: 401 Body: { "error": "unauthorized", "error_description": "The phone number or password is incorrect." } Status Code: 404 Body: { "error": "not_found", "error_description": "The phone number is not associated with an existing account." } Status Code: 500 Body: { "error": "server_error", "error_description": "The server encountered an internal error or misconfiguration and was unable to complete your request." }

micro7duylong commented 1 year ago

nhaps 1.2 Visitor does not see the sign up button on the dash board. 1.3. Visitor taps sign-up button but sign-up form does not appear.

  1. There is nothing on the form when signup form appear.
  2. Visitor doesn't know how to open keyboard.
  3. Visitor doesn't know how to close keyboard.
  4. The form has one fields: email or phone number.
  5. Visitor types invalid or valid Phone number , button "get otp" disabled/enable.
  6. Visitor does not know they are typing invalid phone number
  7. Visitor submits valid form but can not be navigated to OTP verification page.
  8. Visitor does not received OTP code.
  9. Visitor submits correct OTP code but system responses an error message.