From 1a763a9ac33c794e1dcadac167d0aada4914ca73 Mon Sep 17 00:00:00 2001 From: mvpratt <24981541+mvpratt@users.noreply.github.com> Date: Fri, 24 Mar 2023 10:32:42 -0600 Subject: [PATCH] add instructions for testing with local auth --- README.md | 2 +- docs/local-auth.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 docs/local-auth.md diff --git a/README.md b/README.md index 16fe4f65..1edff1e5 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ We're discussing if it's possible to provide SN on nostr and/or a hybrid approac 2. `git clone git@github.com:stackernews/stacker.news.git sn && cd sn` 3. `docker-compose up --build` -You should then be able to access the site at `localhost:3000` and any changes you make will hot reload. If you want to login locally or use lnd you'll need to modify `.env.sample` appropriately. If you have trouble please open an issue so I can help and update the README for everyone else. +You should then be able to access the site at `localhost:3000` and any changes you make will hot reload. If you want to login locally or use lnd you'll need to modify `.env.sample` appropriately. More details [here](https://github.com/stackernews/stacker.news/tree/master/docs/local-auth.md). If you have trouble please open an issue so I can help and update the README for everyone else. # stack The site is written in javascript using Next.js, a React framework. The backend API is provided via graphql. The database is postgresql modelled with prisma. The job queue is also maintained in postgresql. We use lnd for our lightning node. A customized Bootstrap theme is used for styling. diff --git a/docs/local-auth.md b/docs/local-auth.md new file mode 100644 index 00000000..85eb6346 --- /dev/null +++ b/docs/local-auth.md @@ -0,0 +1,36 @@ +# Local Auth + +You must be logged in to test features like posting, replying, tipping, etc. + +### Login with Email + +- First, follow the local development instructions in the README.md +- Create a Sendgrid account (or other smtp service) +- Update your .env file + +``` +LOGIN_EMAIL_SERVER=smtp://apikey:@smtp.sendgrid.net:587 +LOGIN_EMAIL_FROM= +``` + +- Open http://localhost:3000 +- Click "sign up" and enter your email address +- Check your email +- Click the link (looks like this): + +``` +http://localhost:3000/api/auth/callback/email?email=satoshi%40gmail.com&token=110e30a954ce7ca643379d90eb511640733de405f34a31b38eeda8e254d48cd7 +``` + +### Login with Github + +- [Create a new OAuth app](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) in your Github account + - Set the callback URL to: `http://localhost:3000/api/auth/callback/github` +- Update your .env file + +``` +GITHUB_ID= +GITHUB_SECRET= +``` +- Signup and login as above +