-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from studio-recoding/dev
[⚠️ !HOTFIX] 12차 배포
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/Ness/Backend/domain/auth/oAuth/OAuthFailureHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package Ness.Backend.domain.auth.oAuth; | ||
|
||
import Ness.Backend.global.error.ErrorCode; | ||
import Ness.Backend.global.error.exception.OAuthVerificationException; | ||
import jakarta.servlet.ServletException; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.security.core.AuthenticationException; | ||
import org.springframework.security.web.authentication.AuthenticationFailureHandler; | ||
|
||
import java.io.IOException; | ||
@Slf4j | ||
@RequiredArgsConstructor | ||
public class OAuthFailureHandler implements AuthenticationFailureHandler { | ||
@Override | ||
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { | ||
throw new OAuthVerificationException(exception.getMessage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/Ness/Backend/global/error/exception/OAuthVerificationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package Ness.Backend.global.error.exception; | ||
|
||
import Ness.Backend.global.error.ErrorCode; | ||
import lombok.Getter; | ||
@Getter | ||
public class OAuthVerificationException extends BaseException { | ||
public OAuthVerificationException() { | ||
super(ErrorCode.OAUTH_ERROR, ErrorCode.OAUTH_ERROR.getMessage()); | ||
} | ||
public OAuthVerificationException(String message) { | ||
super(ErrorCode.OAUTH_ERROR, message); | ||
} | ||
public OAuthVerificationException(ErrorCode errorCode) { | ||
super(errorCode, errorCode.getMessage()); | ||
} | ||
} |