@riligar/auth-elysia 1.4.1 → 1.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/dist/index.esm.js CHANGED
@@ -276,11 +276,11 @@ function authPlugin(userConfig = {}) {
276
276
  const authClient = new RiLiGarAuthClient(config.apiUrl, config.secretKey);
277
277
 
278
278
  return new Elysia({ name: 'auth-plugin' })
279
- .derive(({ request }) => ({
279
+ .onBeforeHandle(createAuthMiddleware(config, authClient))
280
+ .resolve(({ request }) => ({
280
281
  user: request.user || null,
281
282
  authMeta: request.authMeta || null,
282
283
  }))
283
- .onBeforeHandle(createAuthMiddleware(config, authClient))
284
284
  .group(config.prefix, app =>
285
285
  app
286
286
  // Rota de login
package/dist/index.js CHANGED
@@ -280,11 +280,11 @@ function authPlugin(userConfig = {}) {
280
280
  const authClient = new RiLiGarAuthClient(config.apiUrl, config.secretKey);
281
281
 
282
282
  return new elysia.Elysia({ name: 'auth-plugin' })
283
- .derive(({ request }) => ({
283
+ .onBeforeHandle(createAuthMiddleware(config, authClient))
284
+ .resolve(({ request }) => ({
284
285
  user: request.user || null,
285
286
  authMeta: request.authMeta || null,
286
287
  }))
287
- .onBeforeHandle(createAuthMiddleware(config, authClient))
288
288
  .group(config.prefix, app =>
289
289
  app
290
290
  // Rota de login
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riligar/auth-elysia",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
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
@@ -275,11 +275,11 @@ export function authPlugin(userConfig = {}) {
275
275
  const authClient = new RiLiGarAuthClient(config.apiUrl, config.secretKey)
276
276
 
277
277
  return new Elysia({ name: 'auth-plugin' })
278
- .derive(({ request }) => ({
278
+ .onBeforeHandle(createAuthMiddleware(config, authClient))
279
+ .resolve(({ request }) => ({
279
280
  user: request.user || null,
280
281
  authMeta: request.authMeta || null,
281
282
  }))
282
- .onBeforeHandle(createAuthMiddleware(config, authClient))
283
283
  .group(config.prefix, app =>
284
284
  app
285
285
  // Rota de login