@moriajs/auth 0.4.1 → 0.4.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/.turbo/turbo-build.log +1 -1
- package/README.md +24 -0
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @moriajs/auth
|
|
2
|
+
|
|
3
|
+
Authentication plugin for MoriaJS.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **JWT-based**: Secure authentication using JSON Web Tokens.
|
|
8
|
+
- **OAuth Support**: Easy integration with GitHub, Google, and more.
|
|
9
|
+
- **Auth Hooks**: `requireAuth` guard for routes.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { authPlugin, requireAuth } from '@moriajs/auth';
|
|
15
|
+
|
|
16
|
+
await app.use(authPlugin({
|
|
17
|
+
secret: 'your-secret'
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
// Guard a route
|
|
21
|
+
server.get('/me', { preHandler: [requireAuth] }, async (req) => {
|
|
22
|
+
return req.user;
|
|
23
|
+
});
|
|
24
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moriajs/auth",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MoriaJS auth — JWT + httpOnly cookies, pluggable auth system",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"fastify": "^5.2.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@moriajs/core": "0.4.
|
|
25
|
+
"@moriajs/core": "0.4.2"
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"author": "Guntur-D <guntur.d.npm@gmail.com>",
|