Skip to content

jkettmann/password-based-authentication-with-graphql-and-passport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project was set up using create-react-app. All client side code resides in the /src folder. You can find the code for the GraphQL API inside the /api directory.

Articles of this series

Preparing a GraphQL server for authentication

Password-based authentication with GraphQL and Passport

Facebook login with GraphQL and Passport

Building the React frontend

3 ways for authorization with GraphQL and Apollo

Authorization with GraphQL and custom directives

How to install and run the project

To install and start the app run following commands.

npm install
npm start

Visit http://localhost:4000/graphql. You will see the Apollo playground. There you can run following query and mutation

mutation {
  login(email: "maurice@moss.com", password: "abcdefg") {
    user {
      id
      firstName
      lastName
      email
    }
  }
}

mutation {
  signup(
    firstName: "Jen",
    lastName: "Barber",
    email: "jen@barber.com",
    password: "qwerty"
  ) {
    user {
      id
      firstName
      lastName
      email
    }
  }
}

query {
  currentUser {
    id
    firstName
    lastName
    email
  }
}

mutation {
  logout
}

About

Articles on authentication with GraphQL and Passport.js: password-based authentication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published