Home / Companies / Apollo / Blog / Post Details
Content Deep Dive

Email & password authentication with accounts-js and Apollo Server

Blog post from Apollo

Post Details
Company
Date Published
Author
Leo Pradel
Word Count
1,392
Language
English
Hacker News Points
-
Summary

This tutorial explains how to implement email and password authentication with `accounts-js` and Apollo Server. The author creates a new Node.js project, sets up the dependencies, including `apollo-server`, `graphql`, and `mongoose`. They then configure `accounts-js` to use MongoDB as its database and create an authentication server using `AccountsServer`. The tutorial demonstrates how to merge the `accounts-js` GraphQL schema with the existing schema, creating a new GraphQL API. The author creates a user, authenticates them, and protects a query using the `@auth` directive. They provide a link to a repository containing the source code for this tutorial.