Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gpt_be/schemas/recommendation.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class GptAssistanceRequest(BaseModel):
questionId: int
content: str
answer: str
explanation: str
subjectName: str

class GptAssistanceResponse(BaseModel):
Expand Down
3 changes: 2 additions & 1 deletion gpt_be/utils/perplexity_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def generate_explanation(self, question: str, answer: str, subject: str) -> str:
],
model="sonar", # Perplexity API에서 지원하는 모델
max_tokens=150, # 100자 정도면 충분
temperature=0.5 # 더 결정적인 응답을 위해 낮춤
temperature=0.5, # 더 결정적인 응답을 위해 낮춤
timeout=30 # 30초 타임아웃 설정
)

# 응답 처리
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public ResponseEntity<?> logout(@AuthenticationPrincipal UserDetailsImpl user) {
));
}
}
@GetMapping("/token")
public ResponseEntity<ResponseStatus> checkToken(@AuthenticationPrincipal UserDetailsImpl userDetails) {
return ResponseEntity.ok().build();
}

@DeleteMapping("/user")
public ResponseEntity<?> deleteAccount(@AuthenticationPrincipal UserDetailsImpl user) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ public boolean isRefreshTokenValid(String username, String token) {
log.warn("Refresh token not found in Redis or doesn't match");
return false;
}

String actualToken = token.startsWith(BEARER_PREFIX) ? token.substring(BEARER_PREFIX.length()) : token;
// 2. 토큰 자체 검증
Claims claims = Jwts.parserBuilder()
.setSigningKey(secretKey)
.build()
.parseClaimsJws(token)
.parseClaimsJws(actualToken)
.getBody();

// 3. 토큰 유형 검증
Expand Down
Loading