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

elysia-auth-drizzle

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elysia-auth-drizzle

Library who handle authentification (Header/Cookie/QueryParam).

  • 1.1.0
  • npm
  • Socket score

Version published
Weekly downloads
107
decreased by-52.65%
Maintainers
1
Weekly downloads
 
Created
Source

elysia-auth-drizzle

Library who handle authentification (Header/Cookie/QueryParam).

Usage

import { elysiaAuthDrizzlePlugin } from 'elysia-auth-drizzle';

export const app = new Elysia()
  .use(
      elysiaAuthDrizzlePlugin<typeof users.$inferSelect>({
        config: [
          {
            url: '/public',
            method: 'GET',
          },
        ],
        jwtSecret: 'test',
        drizzle: {
          db: db,
          usersSchema: users,
          tokensSchema: tokens,
        },
      }),
    )

Plugin options

namedefaultdescription
jwtSecretundefinedSecret used to sign JWT
drizzleundefinedContain drizzle db + users schema + tokens schemas ({db, userSchemas, tokenSchemas})
config[]Array who contain url with method allowed in public
cookieSecretundefined(optional) Secret used to sign cookie value
verifyAccessTokenOnlyInJWTfalse(optional) Check only JWT expiration not token validity in DB
userValidationundefined(optional) (user) => void or Promise<void> / Allow to make more check regarding user (ex: check if user is banned)

Tests

To execute jest tests (all errors, type integrity test)

bun test

FAQs

Package last updated on 03 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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