fastify-txstate 3.2.3 → 3.2.5
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/lib/index.d.ts +1 -1
- package/lib/unified-auth.d.ts +1 -1
- package/lib/unified-auth.js +1 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export interface FastifyTxStateOptions extends Partial<FastifyServerOptions> {
|
|
|
77
77
|
*
|
|
78
78
|
* If this function throws, the client will receive a 401 response.
|
|
79
79
|
*/
|
|
80
|
-
authenticate?:
|
|
80
|
+
authenticate?: (req: FastifyRequest) => Promise<FastifyTxStateAuthInfo | undefined>;
|
|
81
81
|
}
|
|
82
82
|
declare module 'fastify' {
|
|
83
83
|
interface FastifyRequest {
|
package/lib/unified-auth.d.ts
CHANGED
|
@@ -58,5 +58,5 @@ declare class TxStateUAuthContext extends Context {
|
|
|
58
58
|
authFromPayload(payload: JWTPayload): Promise<FastifyTxStateAuthInfo>;
|
|
59
59
|
}
|
|
60
60
|
export declare function unifiedAuthenticate(req: FastifyRequest, ContextClass?: typeof TxStateUAuthContext): Promise<FastifyTxStateAuthInfo | undefined>;
|
|
61
|
-
export declare function unifiedAuthenticateAll(req: FastifyRequest, ContextClass?: typeof TxStateUAuthContext): Promise<
|
|
61
|
+
export declare function unifiedAuthenticateAll(req: FastifyRequest, ContextClass?: typeof TxStateUAuthContext): Promise<FastifyTxStateAuthInfo>;
|
|
62
62
|
export {};
|
package/lib/unified-auth.js
CHANGED
|
@@ -141,5 +141,6 @@ async function unifiedAuthenticateAll(req, ContextClass = TxStateUAuthContext) {
|
|
|
141
141
|
const auth = await ctx.waitForAuth();
|
|
142
142
|
if (!(auth === null || auth === void 0 ? void 0 : auth.username.length))
|
|
143
143
|
throw new Error('All requests require authentication.');
|
|
144
|
+
return auth;
|
|
144
145
|
}
|
|
145
146
|
exports.unifiedAuthenticateAll = unifiedAuthenticateAll;
|