@plumier/jwt
Advanced tools
Comparing version 1.0.0-canary.40 to 1.0.0-canary.41
import { AuthorizeStore, DefaultFacility, PlumierApplication, RouteInfo } from "@plumier/core"; | ||
import jwt from 'koa-jwt'; | ||
export declare type RoleField = string | ((value: any) => Promise<string[]>); | ||
@@ -11,5 +12,5 @@ export interface JwtAuthFacilityOption { | ||
private option; | ||
constructor(option: JwtAuthFacilityOption); | ||
constructor(option: JwtAuthFacilityOption & jwt.Options); | ||
setup(app: Readonly<PlumierApplication>): void; | ||
initialize(app: Readonly<PlumierApplication>, routes: RouteInfo[]): Promise<void>; | ||
} |
@@ -16,3 +16,3 @@ "use strict"; | ||
app.set({ authorizer: this.option.authorizer }); | ||
app.koa.use(koa_jwt_1.default({ secret: this.option.secret, passthrough: true })); | ||
app.koa.use(koa_jwt_1.default(Object.assign(Object.assign({ cookie: "Authorization" }, this.option), { secret: this.option.secret, passthrough: true }))); | ||
app.use(new core_1.AuthorizeMiddleware(this.option.roleField || "role", this.option.global)); | ||
@@ -19,0 +19,0 @@ } |
{ | ||
"name": "@plumier/jwt", | ||
"version": "1.0.0-canary.40+0344edd", | ||
"version": "1.0.0-canary.41+fac0173", | ||
"description": "Plumier authorization module using JWT", | ||
@@ -13,3 +13,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@plumier/core": "1.0.0-canary.40+0344edd", | ||
"@plumier/core": "1.0.0-canary.41+fac0173", | ||
"koa-jwt": "^3.6.0" | ||
@@ -27,3 +27,3 @@ }, | ||
}, | ||
"gitHead": "0344edd674043421527e30d18509bb31fa8911c8" | ||
"gitHead": "fac0173804a41548a42032d50104cd5e764e6384" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
12338
38