Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastify/auth

Package Overview
Dependencies
Maintainers
19
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/auth - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

7

auth.d.ts

@@ -1,2 +0,3 @@

import { FastifyPluginCallback, FastifyRequest, FastifyReply, preHandlerHookHandler, FastifyInstance } from 'fastify';
import { ContextConfigDefault, FastifyInstance, FastifyPluginCallback, FastifyReply, FastifyRequest, FastifySchema, preHandlerHookHandler } from 'fastify';
import { RouteGenericInterface } from 'fastify/types/route';

@@ -11,3 +12,3 @@ export type FastifyAuthFunction = (

declare module 'fastify' {
interface FastifyInstance {
interface FastifyInstance<RawServer, RawRequest, RawReply, Logger, TypeProvider> {
auth(

@@ -19,3 +20,3 @@ functions: FastifyAuthFunction[],

}
): preHandlerHookHandler;
): preHandlerHookHandler<RawServer, RawRequest, RawReply, RouteGenericInterface, ContextConfigDefault, FastifySchema, TypeProvider>;
}

@@ -22,0 +23,0 @@ }

{
"name": "@fastify/auth",
"version": "3.0.1",
"version": "3.0.2",
"description": "Run multiple auth functions in Fastify",

@@ -13,3 +13,3 @@ "repository": {

"clean": "rimraf authdb",
"standard": "standard",
"lint": "standard",
"test": "npm run test:unit && npm run test:typescript",

@@ -36,3 +36,5 @@ "test:ci": "standard && tap -J ./test/*.test.js --coverage-report=lcovonly && npm run test:typescript",

"@fastify/leveldb": "^5.0.1",
"@types/node": "^17.0.32",
"@fastify/type-provider-json-schema-to-ts": "^1.0.0",
"@fastify/type-provider-typebox": "^1.0.0",
"@types/node": "^18.0.0",
"fastify": "^4.0.0-rc.3",

@@ -43,3 +45,3 @@ "pre-commit": "^1.2.2",

"tap": "^16.0.0",
"tsd": "^0.20.0",
"tsd": "^0.21.0",
"typescript": "^4.0.2"

@@ -46,0 +48,0 @@ },

import fastify, { FastifyRequest, FastifyReply, preHandlerHookHandler, FastifyInstance } from 'fastify';
import fastifyAuth from '../auth'
import { expectType } from 'tsd';
import { TypeBoxTypeProvider } from '@fastify/type-provider-typebox'
import { JsonSchemaToTsProvider } from '@fastify/type-provider-json-schema-to-ts'

@@ -41,1 +43,19 @@ const app = fastify();

});
const typebox = fastify().withTypeProvider<TypeBoxTypeProvider>()
typebox.register(fastifyAuth)
typebox.route({
method: 'GET',
url: '/',
preHandler: typebox.auth([]),
handler: () => {}
})
const jsonSchemaToTS = fastify().withTypeProvider<JsonSchemaToTsProvider>()
jsonSchemaToTS.register(fastifyAuth)
jsonSchemaToTS.route({
method: 'GET',
url: '/',
preHandler: jsonSchemaToTS.auth([]),
handler: () => {}
})

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc