hyperf-ext / jwt

The Hyperf JWT package.
MIT License
52 stars 23 forks source link

可以生成RefreshToken吗 #6

Closed shangeyao closed 3 years ago

shangeyao commented 3 years ago

如题

canren commented 3 years ago

这种的跟下包的代码就能看到了,刷新 token 的链接,记得在 header 中要携带 Authorization: Bearer {token}

try {
    $token = $this->auth->guard()->refresh();
} catch (\Throwable $throwable) {
    throw new BusinessException(ErrorCode::TOKEN_ERROR);
}
ericyzhu commented 3 years ago

独立的 RefreshToken 暂无计划,目前的实现如 @canren 所述,通过未过刷新期限的 AccessToken 来换取新 Token。

shangeyao commented 3 years ago

感谢回答!