@zshn-dev/auth-server 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @zshn-dev/auth-server
|
|
2
2
|
|
|
3
3
|
> GitHub OAuth + JWT authentication middleware for Express.
|
|
4
4
|
|
|
5
|
-
> **Note:** `@your-scope` is a placeholder — replace it with your actual npm scope.
|
|
6
|
-
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
## Installation
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
|
-
npm install @
|
|
10
|
+
npm install @zshn-dev/auth-server
|
|
13
11
|
```
|
|
14
12
|
|
|
15
13
|
---
|
|
@@ -18,7 +16,7 @@ npm install @your-scope/auth-server
|
|
|
18
16
|
|
|
19
17
|
```ts
|
|
20
18
|
import express from 'express';
|
|
21
|
-
import { createAuthRouter, verifyJwt } from '@
|
|
19
|
+
import { createAuthRouter, verifyJwt } from '@zshn-dev/auth-server';
|
|
22
20
|
|
|
23
21
|
const config = {
|
|
24
22
|
clientId: process.env.GITHUB_CLIENT_ID!,
|
|
@@ -104,7 +102,7 @@ app.get('/api/profile', verifyJwt(config), (req, res) => {
|
|
|
104
102
|
Use `transformUser` to control which fields from the GitHub profile are included in the JWT payload:
|
|
105
103
|
|
|
106
104
|
```ts
|
|
107
|
-
import { createAuthRouter, GitHubProfile } from '@
|
|
105
|
+
import { createAuthRouter, GitHubProfile } from '@zshn-dev/auth-server';
|
|
108
106
|
|
|
109
107
|
app.use('/auth', createAuthRouter({
|
|
110
108
|
...config,
|