You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jwt.js 793B

12345678910111213141516171819202122232425262728
  1. 'use strict'
  2. module.exports = options => {
  3. return {
  4. key: options.jwtKey,
  5. verifyOptions: {
  6. algorithms: ['HS256'],
  7. },
  8. validate: (decoded, request, h) => {
  9. console.log('decoded :>>', decoded)
  10. try {
  11. // Check if the Access Token is Valid
  12. // if (!accessTokenIsValid) {
  13. // Look up if the Session is Active
  14. // } else {
  15. // isValid: true
  16. // }
  17. return {
  18. isValid: true,
  19. credentials: { user: artifacts.decoded.payload.user },
  20. }
  21. } catch (err) {
  22. console.error(err)
  23. return { isValid: false }
  24. }
  25. },
  26. }
  27. }