npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

feathers-auth-extend

v1.0.13

Published

Adds sign up verification, forgotten password reset, passwordless login, refresh token and other capabilities to feathers

Downloads

44

Readme

feathers-auth-extend

Plugin to extend the basic auth system for feathersjs adding

  • Password less Authentication
  • Verify Email on Signup (if not password less)
  • Refresh Tokens

To make it easy to work with, I have not removed access to the built in authentication service which can still be set up with things like oauth, you can also set your own auth path in the config

Installation

npm install feathers-auth-extend --save

How to use

In your config file (eg config/default.json) add

  "feathers-mail": {
    "from": "[email protected]",
    "smtp": {
        "host": "smtp.host.here",
        "secure": true,
        "auth": {
          "user": "[email protected]",
          "pass": "replacewithpassword"
        }
    }
  },
  "feathers-auth-extend": {
    "name": "API NAME",
    "route": "/auth",
    "magicTokens": true,
    "refreshTokens": true,
    "refreshExpires": "30d",
    "securePasswords": true,
    "zxcvbn": 3,
    "user": {
      "verifyEmail": true,
      "keepBefore": ["email", "password", "createdAt", "updatedAt"],
      "keepAfter": ["_id", "id"]
    }
  }

If you wish to capture other items in your create account process, add them to user.KeepBefore.

If you wish to output user items after successful login, add them to user.Keepafter

####Install plugin in app.js after "app.configure(channels);"

// auth extend plugin
app.configure(require('feathers-auth-extend'));

Example usages

Password less Login (with auto create account)


GET Request:
https://api.url/authManage/[email protected]

This will then email an auth token that can be used as below

POST https://api.url/auth

{
    "action": "loginToken",
    "email": "[email protected]",
    "login_token": "CodEHeRe"
}

This will login the user and mark them as a verified User

Refresh Token

POST https://api.url/auth

{
    "action": "refresh",
    "refresh_token": "refrehstokengoeshere.........."
}

This will issue a new auth token to the default amount set up in your config

Verify Account

POST https://api.url/authManage

{
    "action": "verifyAccount",
    "email": "[email protected]",
    "token": "CodEhERe"
}

Reset password request

POST https://api.url/authManage

{
    "action": "resetPassword",
    "email": "[email protected]"

}

Reset password verify

POST https://api.url/authManage

{
    "action": "verifyReset",
    "email": "[email protected]",
    "token": "CodEhERe",
    "password": "SeCUREPassHERE"
}

License

Copyright (c) 2020

Licensed under the MIT license.