mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-01 10:21:26 +08:00
accessToken.getScope() != null
This commit is contained in:
@@ -41,7 +41,7 @@ import static org.hswebframework.web.oauth2.core.ErrorType.*;
|
||||
public class DefaultRefreshTokenGranter extends AbstractAuthorizationService implements RefreshTokenGranter {
|
||||
|
||||
//默认有效时间为1年
|
||||
private long refreshTokenTimeOut = 365 * 24 * 60 * 60 * 1000L;
|
||||
private long refreshTokenTimeOut = 365_24_60_60_1000L;
|
||||
|
||||
public void setRefreshTokenTimeOut(long refreshTokenTimeOut) {
|
||||
this.refreshTokenTimeOut = refreshTokenTimeOut;
|
||||
@@ -71,7 +71,7 @@ public class DefaultRefreshTokenGranter extends AbstractAuthorizationService imp
|
||||
return accessToken;
|
||||
}
|
||||
Set<String> newRange = request.getScope() != null ? request.getScope() : accessToken.getScope();
|
||||
if (!accessToken.getScope().containsAll(newRange)) {
|
||||
if (accessToken.getScope() != null && !accessToken.getScope().containsAll(newRange)) {
|
||||
throw new GrantTokenException(ErrorType.SCOPE_OUT_OF_RANGE);
|
||||
}
|
||||
accessToken.setAccessToken(accessTokenService.createToken().getAccessToken());
|
||||
|
||||
Reference in New Issue
Block a user