chore: rename package [skip publish]

This commit is contained in:
Chen Asraf
2022-11-25 17:09:38 +02:00
parent 4492548986
commit 6253fa6a45
3 changed files with 7 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
# otipi
# express-otp
Incredibly simple TOTP authentication for your Node.JS/Express backend.
@@ -13,10 +13,10 @@ See [src/example/server.ts](src/example/server.ts) for a fully working example u
### Initialize
First, use the `otipi` function to generate middleware and functions for your use:
First, use the `express-otp` function to generate middleware and functions for your use:
```typescript
const totp = otipi({
const totp = otp({
// Any identifier that is for your app
issuer: 'my-issuer',
// This should return user information if a request contains a valid user

View File

@@ -1,9 +1,9 @@
{
"name": "otipi",
"name": "express-otp",
"version": "0.1.0",
"description": "Easy auth with your admin endpoints using OTP",
"main": "index.js",
"repository": "https://github.com/chenasraf/otipi",
"repository": "https://github.com/chenasraf/express-otp",
"author": "Chen Asraf <contact@casraf.dev>",
"license": "MIT",
"scripts": {

View File

@@ -1,5 +1,5 @@
import express from 'express'
import otipi from '..'
import otp from '..'
import dotenv from 'dotenv'
dotenv.config()
@@ -8,7 +8,7 @@ const app = express()
const sampleUser = { id: 1, username: process.env.USER_NAME!, secret: process.env.USER_SECRET! }
const totp = otipi<typeof sampleUser>({
const totp = otp<typeof sampleUser>({
issuer: 'my-issuer',
getUser: (req) => {
const user = [sampleUser].find((x) => x.username === req.query.username)