0.0.1 • Published 1 year ago

authey-test v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Authey

Expose Auth.js REST APIs to your express/connect apps.

Install

pnpm add @auth/core authey

Usage

Express

import express from 'express'

import { createAuthMiddleware } from 'authey'
import type { AuthOptions } from '@auth/core'
import GithubProvider from '@auth/core/providers/github'

const app = express()

const authOptions: AuthOptions = {}
app.use(createAuthMiddleware(authOptions))

Nuxt

// server/middleware/auth.ts
import { createAuthMiddleware } from 'authey'

export default fromNodeMiddleware(createAuthMiddleware({}))

Fastify

import Fastify from 'fastify'
import Middie from '@fastify/middie'
import { createAuthMiddleware } from 'authey'

async function build() {
  const fastify = Fastify()
  await fastify.register(Middie)
  fastify.use(createAuthMiddleware({}))
  return fastify
}

License

MIT License © 2022 Robert Soriano