Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-request-user

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-request-user

hapi plugin that shortcuts request.auth.credentials to request.user

  • 2.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
4
Weekly downloads
 
Created
Source
hapi-request-user logo

hapi plugin that shortcuts “request.auth.credentials” to “request.user”


Installation · Usage ·



Build Status hapi-request-user Version Monthly downloads

Follow @marcuspoehls for updates!


Development of this hapi plugin is supported by Future Studio University 🚀
Join the Future Studio University and Skyrocket in Node.js


Introduction

A hapi plugin that shortcuts access to the authenticated user from request.auth.credentials to request.user.

Access the authenticated user in request lifecycle methods, like this:

{
  method: 'GET',
  path: '/authenticated-user',
  handler: (request, h) => {
    return request.user  // instead of "request.auth.credentials"
  }
}

Requirements

hapi v17 and Node.js v8 (or newer)

This plugin requires hapi v17 (or later) and uses async/await which requires Node.js v8 or newer.

Installation

Add hapi-request-user as a dependency to your project:

npm i hapi-request-user

Usage

Register the hapi-request-user plugin and you’re done:

await server.register({
  plugin: require('hapi-request-user'),
})

Feature Requests

Do you miss a feature? Please don’t hesitate to create an issue with a short description of your desired addition to this plugin.

Contributing

  1. Create a fork
  2. Create your feature branch: git checkout -b my-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request 🚀

License

MIT © Future Studio


futurestud.io  ·  GitHub @futurestudio  ·  Twitter @futurestud_io

Keywords

FAQs

Package last updated on 17 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc