feat: token 생성시 refresh token 유효기간도 return 받도록 추가

dev
gitea-관리자 12 months ago
parent b67ffb55f4
commit 0fd1c32022

@ -93,6 +93,7 @@ public class JwtTokenProvider {
.authorizationType(JwtToken.HEADER_NAME.getCode()) .authorizationType(JwtToken.HEADER_NAME.getCode())
.accessToken(accessToken) .accessToken(accessToken)
.accessTokenExpiresIn(accessTokenExpiresIn.getTime()) .accessTokenExpiresIn(accessTokenExpiresIn.getTime())
.refreshTokenExpiresIn(refreshTokenExpiresIn.getTime())
.refreshToken(refreshToken) .refreshToken(refreshToken)
.build(); .build();
} }
@ -167,7 +168,7 @@ public class JwtTokenProvider {
public String resolveAccessToken(HttpServletRequest request) { public String resolveAccessToken(HttpServletRequest request) {
String bearerToken = request.getHeader(JwtToken.HEADER_NAME.getCode()); String bearerToken = request.getHeader(JwtToken.HEADER_NAME.getCode());
if (StringUtils.hasText(bearerToken) && bearerToken.startsWith(JwtToken.GRANT_TYPE.getCode())) { if (StringUtils.hasText(bearerToken) && bearerToken.startsWith(JwtToken.GRANT_TYPE.getCode())) {
return bearerToken.substring(JwtToken.GRANT_TYPE.getCode().length()+1); return bearerToken.substring(JwtToken.GRANT_TYPE.getCode().length()+2);
} }
return null; return null;
} }

Loading…
Cancel
Save