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.

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. module.exports = (options) => {
  3. return {
  4. keys: {
  5. key: options.jwtKey,
  6. algorithms: ['HS256']
  7. },
  8. verify: {
  9. aud: 'urn:audience:test',
  10. iss: 'urn:issuer:test',
  11. sub: false,
  12. },
  13. validate: (artifacts, request, h) => {
  14. try {
  15. return {
  16. isValid: true,
  17. credentials: { user: artifacts.decoded.payload.user }
  18. }
  19. }
  20. catch (err) {
  21. console.error(err)
  22. return {
  23. isValid: false
  24. }
  25. }
  26. }
  27. }
  28. }