dwyl / hapi-auth-jwt2

:lock: Secure Hapi.js authentication plugin using JSON Web Tokens (JWT) in Headers, URL or Cookies
ISC License
798 stars 126 forks source link

feat: store raw and decoded token under artifacts #341

Closed cilindrox closed 4 years ago

cilindrox commented 4 years ago

Use request.auth.artifacts to store a copy of the raw token and decoded payload.

Breaking Changes

request.auth.artifacts is now an object containing the raw token and decoded token fields instead of a string.

Migration Checklist

Artifacts are populated using the decoded (unvalidated) and raw token objects for easy access on the validation callback or any authentication-related actions.

Checklist:

Closes #224 and #284

codecov[bot] commented 4 years ago

Codecov Report

Merging #341 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #341   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines         133    133           
=====================================
  Hits          133    133
Impacted Files Coverage Δ
lib/index.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 98d3c9e...316f061. Read the comment docs.

cilindrox commented 4 years ago

@nelsonic would appreciate your review :)

cilindrox commented 4 years ago

Replaced via #342