Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/login annotation #14

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

mirageoasis
Copy link

@mirageoasis mirageoasis commented Jun 8, 2024

일단 로그인 어노테이션을 추가했습니다.

기본적인 사용법은 다음과 같습니다.

@GetMapping("/annotation")
    @ResponseBody
    public String healthCheckAnnotation(@LoginInfo String userId) {
        return userId;
    }

이런식으로 https://github.com/logininfo 어노테이션을 쓰고 뒤에 인자를 배치하면 로그인한 유저의 email을 jwt 토큰으로 부터 가져올 수 있습니다.

원리는 LoginUserArgumentResolver 에서 파라미터와 인자를 가져와서 처리하는 방식으로 진행됩니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants