New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@strav/jina

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@strav/jina

Headless authentication flows for the Strav framework

latest
npmnpm
Version
0.2.12
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@strav/jina

Headless authentication flows for the Strav framework. Registration, login, logout, password reset, email verification, two-factor authentication (TOTP), password confirmation, and profile updates — all as JSON API endpoints.

Install

bun add @strav/jina
bun strav install jina

Requires @strav/core as a peer dependency.

Setup

import { defineActions } from '@strav/jina'
import User from './models/user'

const actions = defineActions<User>({
  async createUser(data) { return User.create(data) },
  async findByEmail(email) { return User.query().where('email', email).first() },
  async findById(id) { return User.find(id) },
  passwordHashOf(user) { return user.password },
  emailOf(user) { return user.email },
  async updatePassword(user, pw) { user.password = pw; await user.save() },
})
import { JinaProvider } from '@strav/jina'

app.use(new JinaProvider(actions))

Routes

Routes are registered automatically:

MethodPathFeature
POST/registerregistration
POST/loginlogin
POST/logoutlogout
POST/forgot-passwordpassword-reset
POST/reset-passwordpassword-reset
POST/email/sendemail-verification
GET/email/verify/:tokenemail-verification
POST/two-factor/enabletwo-factor
POST/two-factor/confirmtwo-factor
DELETE/two-factortwo-factor
POST/two-factor/challengetwo-factor
POST/confirm-passwordpassword-confirmation
PUT/passwordupdate-password
PUT/profileupdate-profile

Middleware

import { verified, confirmed, twoFactorChallenge } from '@strav/jina'

router.group({ middleware: [auth(), verified()] }, r => {
  r.delete('/account', compose([confirmed()], deleteAccountHandler))
})

Documentation

See the full Jina guide.

License

MIT

FAQs

Package last updated on 09 Apr 2026

Related posts