Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Commit

Permalink
[NOISSUE] fix: 누락된 파일 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevLuffy committed May 19, 2020
1 parent b2da7f2 commit dfc5caf
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.woowacourse.tecobrary.admin.handler;

import com.woowacourse.tecobrary.admin.web.AdminUserDto;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Slf4j
@Component
@RequiredArgsConstructor
public class AdminAuthSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {

@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException {
super.onAuthenticationSuccess(request, response, authentication);
AdminUserDto adminUserDto = (AdminUserDto) authentication.getPrincipal();
log.info("로그인 성공={}", adminUserDto);
}
}

0 comments on commit dfc5caf

Please sign in to comment.