Skip to content

Commit dc61789

Browse files
committed
Clarify where to get the values for githubOrgName and githubOrgAdminToken
1 parent 5d431ae commit dc61789

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,33 @@ The output directory of the static website.
4646

4747
`config.githubOrgName`
4848

49-
The GitHub org users need to be part of.
49+
The GitHub organization users need to be part of in order to be able to sign in.
50+
51+
You cannot use your personal GitHub account for this, you need an organization.
5052

5153
`config.githubClientId`
5254
`config.githubClientSecret`
5355

5456
The id/secret pair of your GitHub OAuth app.
55-
You can create a new app at `https://github.com/organizations/{config.githubOrgName}/settings/applications/new`
57+
58+
Create a new OAuth app at
59+
`https://github.com/organizations/{config.githubOrgName}/settings/applications/new`
5660

5761
`config.githubOrgAdminToken`
5862

59-
Private org memberships can only be determined by making an authenticated API request.
63+
Create a token with `read:org` permission at <https://github.com/settings/tokens>.
6064

61-
We could request `read:org` scope during the OAuth flow and then use each user's access token to determine org membership, but using this method means the user additionally needs to request org access during or after the login flow and requires an org admin to confirm. This makes this approach inconvenient for both the users and the admin.
65+
The reason you need a token is that private org memberships can only be
66+
determined by making an authenticated API request.
6267

63-
Therefore we're using a separate org admin token to verify membership during login (org admins can see all users).
68+
We could request `read:org` scope during the OAuth flow and then use each user's
69+
access token to determine org membership, but using this method means the user
70+
additionally needs to request org access during or after the login flow and
71+
requires an org admin to confirm. This makes this approach inconvenient for both
72+
the users and the admin.
73+
74+
Therefore we're using a separate org admin token to verify membership during
75+
login (org admins can see all users).
6476

6577
### Step 3 — Create a `vercel.json`
6678

@@ -78,13 +90,21 @@ Therefore we're using a separate org admin token to verify membership during log
7890

7991
This routes all traffic through the lambda endpoint.
8092

81-
Adapt `includeFiles` to your public output folder. Including these files is required because the static website needs to be deployed as part of the lambda function, not the default build. See also the [function docs](https://vercel.com/docs/projects/project-configuration#functions) and [size limit docs](https://vercel.com/docs/functions/serverless-functions/runtimes#size-limits).
93+
Adapt `includeFiles` to your public output folder. Including these files is
94+
required because the static website needs to be deployed as part of the lambda
95+
function, not the default build. See also these docs:
96+
97+
- [functions](https://vercel.com/docs/projects/project-configuration#functions)
98+
- [size limits](https://vercel.com/docs/functions/serverless-functions/runtimes#size-limits).
8299

83100
### Step 4 — Build
84101

85-
If you have an existing `build` script, rename it to `vercel-build` to build your website as part of the lambda build instead of the normal build.
102+
If you have an existing `build` script, rename it to `vercel-build` to build
103+
your website as part of the lambda build instead of the normal build.
86104

87-
Make sure to not keep the `build` script as it would result in duplicate work or may break deployment entirely. For more information see [custom-build-step-for-node-js](https://vercel.com/docs/functions/serverless-functions/runtimes/node-js#custom-build-step-for-node.js).
105+
Make sure to not keep the `build` script as it would result in duplicate work or
106+
may break deployment entirely. For more information see
107+
[custom-build-step-for-node-js](https://vercel.com/docs/functions/serverless-functions/runtimes/node-js#custom-build-step-for-node.js).
88108

89109
```json
90110
{
@@ -102,4 +122,5 @@ To develop locally, run
102122
yarn vercel dev
103123
```
104124

105-
When developing locally, you'll need to update your GitHub OAuth app's redirect URL to `http://localhost:3000`.
125+
When developing locally, you'll need to update your GitHub OAuth app's redirect
126+
URL to `http://localhost:3000`.

0 commit comments

Comments
 (0)