Skip to content

amenify/task-auth-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Task:

Implement simple authorization flow based on Figma design and GraphQL queries.

authorization flow

What should you do:

  • Implement 3 screens(Sign In, Sign Up, Home)
  • Text inputs should have a simple validation and email, password, firstName, lastName, switcher are required fields
  • On the Home screen we should see username(firstName + lastName) from myUser query
  • Also on the Home screen user should be able logout
  • Please use BottomTabNavigator from @react-navigation/bottom-tabs to implement bottom bar

What you may need:

Getting Started

  • Create a repo
  • Commit your changes
  • Send a link to the repository via email

Sign In

mutation CreateToken($email: String, $password: String) {
  createTokenByPassword(email: $email, password: $password) {
    token {
      accessToken
      expiresIn
      refreshToken
    }
  }
}

You should get token.accessToken field which you have to use for MyUser query

Sign Up

mutation CreateUser($email: String $firstName: String $lastName: String $password: String) {
  createUser(email: $email firstName: $firstName lastName: $lastName password: $password) {
    success
    token {
      accessToken
      expiresIn
      refreshToken
    }
  }
}

You should get token.accessToken field which you have to use for MyUser query

User info

query MyUser {
  myUser {
    id
    firstName
    lastName
    email
  }
}

For this query, you have to be logged in and send this query with Authorization header. Example:

headers.Authorization = `Bearer ${token.accessToken}`;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published