| 12345678910111213141516171819202122232425262728 |
- 'use strict'
-
- module.exports = options => {
- return {
- key: options.jwtKey,
- verifyOptions: {
- algorithms: ['HS256'],
- },
- validate: (decoded, request, h) => {
- console.log('decoded :>>', decoded)
- try {
- // Check if the Access Token is Valid
- // if (!accessTokenIsValid) {
- // Look up if the Session is Active
- // } else {
- // isValid: true
- // }
- return {
- isValid: true,
- credentials: { user: artifacts.decoded.payload.user },
- }
- } catch (err) {
- console.error(err)
- return { isValid: false }
- }
- },
- }
- }
|