# safe-auth

> General purpose authentication solution for Node.js

Latest version **0.2.1** (published 2019-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install safe-auth
pnpm add safe-auth
yarn add safe-auth
bun add safe-auth
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2019-05-10 |
| First published | 2019-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 54 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Evenset |
| Maintainers | sassanhe |
| Keywords | authentication, javascript, js, typescript, ts |

## Links

- npm: https://www.npmjs.com/package/safe-auth
- Repository: https://github.com/evenset/safe-auth
- Homepage: https://github.com/evenset/safe-auth#readme
- Issues: https://github.com/evenset/safe-auth/issues
- npm.io page: https://npm.io/package/safe-auth

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.1 (latest) — 2019-05-10
- 0.2.0 — 2019-05-10
- 0.1.1 — 2019-05-09
- 0.1.0 — 2019-05-09

## README

[![Build Status](https://travis-ci.org/evenset/safe-auth.svg?branch=development)](https://travis-ci.org/evenset/safe-auth)
[![codecov](https://codecov.io/gh/evenset/safe-auth/branch/development/graph/badge.svg)](https://codecov.io/gh/evenset/safe-auth)
[![npm version](https://badge.fury.io/js/safe-auth.svg)](https://badge.fury.io/js/safe-auth)

# What's safe-auth

safe-auth is a general purpose authentication solution for Node.js.
It's written in TypeScript with %100 test code coverage.

# Features

At its core it provides these features:

1. Create users
1. Activate/Deactivate users
1. Authenticating a user based on their username and password and returning
    the authenticated user
1. Issuing a token for a user
1. Authenticating a user based on an active issued token and returning the
    authenticated user
1. Issuing new token based on a refresh token (signing in)
1. Reset user's password when they forget it
1. Revoking tokens (signing out)
1. Revoking all active tokens of a user (signing out of all devices)
1. Optionally block a user when he has several failed attempts
1. Logging all requests, responses and events
1. Configuring paramters and enabaling/disabling optional features in a
    centralized config system

# Storage engines

By default safe-auth provides an in memory storage engine (not to be used in
production) and it's able to use different storage engines via third party
packages.

Currently there is a third party package that uses Sequelize as the storage
backend which makes Postgres, MySQL, MariaDB, SQLite and Microsoft SQL
available.

TypeORM and Mongoose will be supported by other third party packages soon. So
the goal is to have at least these storage backends for safe-auth:
1. Sequelize
2. TypeORM
3. Mongoose

# Serving options

The core has its API with the JS classes it exposes. One can simply use these
classes in her project. But there are third party packages that provide
different serving options ready out of the box:
1. HTTP POST/GET requests
1. GraphQL
1. Rest

# Reporting bugs

You can report issues/bugs in the github repository of the project:
https://github.com/evenset/safe-auth/issues

---
_Source: https://npm.io/package/safe-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
