Skip to content

Commit 76a8d5b

Browse files
authored
docs: improve social setup documentation (#342)
* Update 02-authentication.md
1 parent 2db18da commit 76a8d5b

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

docs/guide/02-authentication.md

+38-8
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,43 @@ We are using `remix-auth-totp` and [Resend](https://resend.com) to handle email
2828

2929
Social Logins are a great way to authenticate users in web applications. Remix SaaS provides a simple way to authenticate users with their Github account. We are using `remix-auth-github` to handle the authentication process.
3030

31-
- You can create a new OAuth App by visiting [Github Developer Settings](https://github.com/settings/developers) in order to get your `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` API Keys.
32-
33-
Remix Auth Github v2.0:
34-
35-
- If you encounter the issue `Missing or invalid 'expires_in' field` when using GitHub OAuth with recent changes to `remix-auth-github`, you should create a **GitHub App**, instead of using GitHub OAuth. When creating the GitHub App, make sure to grant email permission.
36-
37-
Here's a Pull Request that also includes 2 images to guide you through the process: [PR #323](https://github.com/dev-xo/remix-saas/pull/323/files)
31+
You can create a new Github App or OAuth App by visiting [Github Developer Settings](https://github.com/settings/developers) in order to get your `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` API Keys.
32+
33+
> [!NOTE]
34+
> In most cases you just want to create a Github App instead of an OAuth app.
35+
36+
The details you'll want to provide for each Github App (or OAuth App) are:
37+
38+
- Home Page URL: `http://localhost:3000/`
39+
- Callback URL: `http://localhost:3000/auth/github/callback`
40+
41+
Once created:
42+
43+
- For Github Apps:
44+
- Expand `Account Permissions` section
45+
- Change `Email addresses` to `Read only`
46+
- Ensure that `Optional Features > User-to-Server token expiration` button is labeled `Opt-out`
47+
- Copy the `Client ID` and put it in your `.env` under `GITHUB_CLIENT_ID`
48+
- Click `Generate new client secret`, copy the secret and put it in your `.env` under `GITHUB_CLIENT_SECRET`
49+
50+
> [!NOTE]
51+
> It is preferable to create a separate Github App for each deployed environment; for example:
52+
>
53+
> `Local Development`
54+
>
55+
> ```
56+
> Name: [LOCAL] Your App Name
57+
> Home Page URL: `http://localhost:3000/`
58+
> Callback URL: `http://localhost:3000/auth/github/callback`
59+
> ```
60+
>
61+
> `Production`
62+
>
63+
> ```
64+
> Name: Your App Name
65+
> Home Page URL: `https://myappna.me/`
66+
> Callback URL: `https://myappna.me/auth/github/callback`
67+
> ```
3868
3969
### Authenticate as Admin
4070
@@ -58,4 +88,4 @@ If you have any suggestions or improvements, feel free to open an Issue or a Pul
5888
5989
- [Documentation](https://github.com/dev-xo/remix-saas/tree/main/docs#getting-started)
6090
- [Live Demo](https://remix-saas.fly.dev)
61-
- [Twitter Updates](https://twitter.com/DanielKanem)
91+
- [Twitter Updates](https://twitter.com/DanielKanem)

0 commit comments

Comments
 (0)