Skip to content

Instantly share code, notes, and snippets.

@michaeldmueller
Last active July 16, 2020 15:41
Show Gist options
  • Save michaeldmueller/1bbc9eecc076668f0e5a6a4019827c5c to your computer and use it in GitHub Desktop.
Save michaeldmueller/1bbc9eecc076668f0e5a6a4019827c5c to your computer and use it in GitHub Desktop.

Login Calls

Data Models

User Data

Contains basic user information, such as name and contact information. Could contain address information, or this could be obtained in separate call when editing. Advantage to immediately returning UserData is that if location services aren't enabled, we could localize their nearby restaurants based on shipping address.

UserData {
  id: String                // Whatever it's currently stored as
  fullName: String
  email: String
  phoneNumber: String
  streetAddress: String
  city: String
  state: String
  zip: String
}

Calls

checkIfEmailIsRegistered

Parameters: Email

Used for determining if the user has an account with Foodie Card, or if they need to register their email with a card (or create an account)

login

Parameters: Email, Password

Returns UserData or Error if authentication failed

This would be basic authentication flow that most users would fall under. Their email was recognized, so they submitted credentials. Return UserData if successful

getUserFromCardInfo

Parameters: Full name, Foodie Card ID

Could return UserData or simply the user's email as verification, since the user will still have to confirm their email

This is the screen for submitting the card info if their email was not recognized

sendConfirmationEmail

Parameters: Email

This is for submitting confirmation email if the user recognizes the email provided. The email will contain a url with the URL scheme supported by the app, which would then open the app and confirm the email

passwordSubmitted

Parameters: Email

Returns UserData

If email is confirmed, the user will need to create a password to be linked to their account. This password will be stored in database and used for authentication in the future

createUser

Parameters: Full Name, Email, Password, Zip Code, Mobile Number (optional)

Returns UserData

This will create a new user

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