Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
taeyeongKims committed Jan 16, 2025
1 parent 6eeaf54 commit 0691cd2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.example.api.account.repository;

import com.example.api.domain.Account;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Optional;

Expand All @@ -10,6 +12,7 @@ public interface AccountRepository extends JpaRepository<Account, Long> {

boolean existsByEmail(String email);

@EntityGraph(attributePaths = "roles")
Optional<Account> findByEmail(String email);

Optional<Account> findUserByLoginId(String loginId);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/example/api/domain/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import java.util.Collection;

import static jakarta.persistence.FetchType.*;


@Entity
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static class FailedAuthenticationEntryPoint implements AuthenticationEntryPoint
@Override
public void commence(HttpServletRequest request,
HttpServletResponse response,
AuthenticationException authException) throws IOException, ServletException {
AuthenticationException authException) throws IOException {
response.setContentType("application/json");
response.setStatus(HttpServletResponse.SC_FORBIDDEN);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
Expand All @@ -34,6 +35,7 @@
import static com.example.api.oauth2.entity.HttpCookieOAuth2AuthorizationRequestRepository.REDIRECT_URI_PARAM_COOKIE_NAME;

@Component
@Slf4j
@RequiredArgsConstructor
public class OAuth2AuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
private final JwtTokenProvider tokenProvider;
Expand Down

0 comments on commit 0691cd2

Please sign in to comment.