Skip to content

Commit

Permalink
[BE] Fix/#424 refresh token duplicated (#425)
Browse files Browse the repository at this point in the history
* fix: RefreshToken Payload ์ถ”๊ฐ€ ๋ฐ CORS ์™„ํ™”

* fix: Refresh Token Header ํ—ˆ์šฉ
  • Loading branch information
junpakPark authored and kpeel5839 committed Sep 17, 2023
1 parent 303a5fb commit 14a72b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import java.util.Date;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class JwtTokenProvider implements TokenProvider {

private static final String EMPTY = "";

private final String secretKey;
private final long accessExpirationTime;
private final long refreshExpirationTime;
Expand All @@ -41,7 +40,9 @@ public String createAccessToken(String payload) {
}

public String createRefreshToken() {
return createToken(EMPTY, refreshExpirationTime);
UUID payload = UUID.randomUUID();

return createToken(payload.toString(), refreshExpirationTime);
}

private String createToken(String payload, Long validityInMilliseconds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public void addCorsMappings(CorsRegistry registry) {
.allowedOrigins("http://localhost:3000", "https://mapbefine.kro.kr", "https://mapbefine.com")
.allowedHeaders("refresh-token")
.allowedMethods("*")
.allowCredentials(true)
.exposedHeaders(LOCATION, SET_COOKIE);
}

Expand Down

0 comments on commit 14a72b9

Please sign in to comment.