Javascript Netlify Identity/GoTrue js用户JWT是否过期?

Javascript Netlify Identity/GoTrue js用户JWT是否过期?,javascript,jwt,netlify,Javascript,Jwt,Netlify,使用与netlify的身份验证服务(称为“身份”)接口,需要多长时间执行以下操作: const user = auth.currentUser(); const jwt = user.jwt(); jwt .then(response => console.log("This is a JWT token", response)) .catch(error => { console.log("Error fetching JWT token", error);

使用与netlify的身份验证服务(称为“身份”)接口,需要多长时间执行以下操作:

const user = auth.currentUser();
const jwt = user.jwt();
jwt
  .then(response => console.log("This is a JWT token", response))
  .catch(error => {
    console.log("Error fetching JWT token", error);
    throw error;
  });

由此产生的JWT将永远有效吗?用户登录会话的持续时间?或者它是否在给定的时间后过期?

通常
JWT
s contain可以(可选)包含一个
exp
(过期)声明,其中包含它将过期的时间

我没有使用
GoTrue
的经验,但根据他们的经验,您可以配置,并将其设置为默认值3600秒

由于库还可以使用刷新令牌,因此在令牌过期后,您不必再次进行身份验证,而是使用刷新令牌来获取新的访问令牌