dsdenes / hapi-auth-firebase

Hapi authentication plugin to verify JWT token provided by the firebase client library.
9 stars 4 forks source link

Feature: ES5 Environment #2

Closed armand1m closed 6 years ago

armand1m commented 6 years ago

Currently, this code doesn't runs in ES5 environments.

/usr/src/app/node_modules/hapi-auth-firebase/lib/index.js:22
async function raiseError(errorFunc, errorContext) {
      ^^^^^^^^
SyntaxError: Unexpected token function
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/src/app/lib/index.js:30:17)
    at Module._compile (module.js:570:32)

This error is throw when importing the package using Node 6.11.0

dsdenes commented 6 years ago

Good point, thank you! https://github.com/dsdenes/hapi-auth-firebase/commit/b70bc96e4ed60b8c69c6bc79b94d236e56df87d5

armand1m commented 6 years ago

Nice, it is already published on npm?