Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Firefox and Safari, jwt.verify raises Error.capturestacktrace is not a function #402

Closed
tsetenl2 opened this issue Sep 22, 2017 · 5 comments

Comments

@tsetenl2
Copy link

tsetenl2 commented Sep 22, 2017

I've started testing my application outside of Chrome and started receiving the error regarding Error.capturestacktrace is not a function.

I have both the latest Firefox and Safari. The token verification works fine on the latest version of Chrome. This error occurs specifically after the token is expired and I attempt to verify it.

The token verification below is executed during specific route transitions on the client side. The error caused prevents me from logging inside of the verification callback.

 jwt.verify(
      token,
      secret,
      function(err, verifiedJwt) {
        if (err) {
          if (
            err.name === "TokenExpiredError" ||
            err.name === "JsonWebTokenError"
            ) {
            next("/logout");
        }
      } else {
          //Refresh token if it is not expired
          store.dispatch("REFRESH_TOKEN", token);
        }
      }
  );
joovel pushed a commit to joovel/node-jsonwebtoken that referenced this issue Sep 27, 2017
@joovel
Copy link
Contributor

joovel commented Sep 27, 2017

@ziluvatar : I've added a PR to ensure that captureStackTrace is truthy before attempting to call it.

@joovel
Copy link
Contributor

joovel commented Sep 27, 2017

@ziluvatar : I'm also curious if browser support is a thing for this project ... both this repo and jws specifically call out node, but there's no explicit statement in the README whether browsers are supported or not.

@ziluvatar
Copy link
Contributor

This project focus is NodeJS, nevertheless since the community seems to be using it for browsers, we balance the issue, the effort to maintain node vs browser and it makes sense.

@ziluvatar
Copy link
Contributor

PR was merged. It's on v8.1.0

@tsetenl2
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants