learn hapi — Check Refresh Token in Authentication Strategy

You implemented refresh token handling for multiple devices in the previous tutorial. The core of that implementation lives in the route handler which assigns the route handler for the refresh token three tasks:

  1. find an active refresh token for the incoming input
  2. invalidate the incoming refresh token
  3. create a new refresh token and send out the response

In this tutorial, you’ll improve the implementation by using hapi’s framework capabilities along the request lifecycle. You’ll move the first two tasks into an authentication strategy to focus the responsibility of the route handler to create a new refresh token and send it along in the response.

hapi Series Overview

Continue reading

University Enrollment Required

Future Students benefit from value packed videos and tutorials.

Enroll to receive exclusive content or sign in if you’re already a Future Student.

Enroll me for $15/mo

Explore the Library

Find interesting tutorials and solutions for your problems.