2

我一直在尝试自定义自定义授权方以在令牌过期时注销用户或将用户重定向到登录页面。我正在使用 auth0、api-gate,我对这两者都是新手,并且我正在使用 aws-node 和 jwt 来验证用户令牌。

这是我的 authorizer.js

const jwt = require('jsonwebtoken');
exports.handler = (event) {
  const token = event.authorizationToken;
  try {
    jwt.verify(token,.....) // I am verifing token and I get back expired token and hitting the catch block but, there I don't know how to make the user redirect or respond with 302, I have tried many ways
  } catch(e) { 
      // what to do here?
  }
};

在此先感谢,非常感谢您的帮助。如果我采取了错误的方法,请告诉我是新手,任何建议都非常感谢。再次感谢

4

0 回答 0