@riligar/auth-elysia 1.5.0 → 1.6.0

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/dist/index.esm.js CHANGED
@@ -280,9 +280,9 @@ function authPlugin(userConfig = {}) {
280
280
  // Instanciar cliente Auth
281
281
  const authClient = new RiLiGarAuthClient(config.apiUrl, config.secretKey);
282
282
 
283
- return new Elysia({ name: 'auth-plugin' })
283
+ return new Elysia({ name: 'auth-plugin', scoped: false })
284
284
  .onBeforeHandle(createAuthMiddleware(config, authClient))
285
- .resolve(({ request }) => ({
285
+ .derive(({ request }) => ({
286
286
  user: request.user || null,
287
287
  authMeta: request.authMeta || null,
288
288
  }))
package/dist/index.js CHANGED
@@ -284,9 +284,9 @@ function authPlugin(userConfig = {}) {
284
284
  // Instanciar cliente Auth
285
285
  const authClient = new RiLiGarAuthClient(config.apiUrl, config.secretKey);
286
286
 
287
- return new elysia.Elysia({ name: 'auth-plugin' })
287
+ return new elysia.Elysia({ name: 'auth-plugin', scoped: false })
288
288
  .onBeforeHandle(createAuthMiddleware(config, authClient))
289
- .resolve(({ request }) => ({
289
+ .derive(({ request }) => ({
290
290
  user: request.user || null,
291
291
  authMeta: request.authMeta || null,
292
292
  }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riligar/auth-elysia",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "description": "Auth SDK for ElysiaJS with JWT and JWKS",
6
6
  "main": "dist/index.js",
package/src/index.js CHANGED
@@ -279,9 +279,9 @@ export function authPlugin(userConfig = {}) {
279
279
  // Instanciar cliente Auth
280
280
  const authClient = new RiLiGarAuthClient(config.apiUrl, config.secretKey)
281
281
 
282
- return new Elysia({ name: 'auth-plugin' })
282
+ return new Elysia({ name: 'auth-plugin', scoped: false })
283
283
  .onBeforeHandle(createAuthMiddleware(config, authClient))
284
- .resolve(({ request }) => ({
284
+ .derive(({ request }) => ({
285
285
  user: request.user || null,
286
286
  authMeta: request.authMeta || null,
287
287
  }))