|
1 |
| -package entry.dsm.gitauth.equusgithubauth.domain.auth.presentation.controller |
2 |
| - |
3 |
| -import entry.dsm.gitauth.equusgithubauth.domain.user.presentation.dto.response.TokenResponse |
4 |
| -import entry.dsm.gitauth.equusgithubauth.domain.user.service.UserService |
5 |
| -import org.springframework.security.core.annotation.AuthenticationPrincipal |
6 |
| -import org.springframework.security.oauth2.core.user.OAuth2User |
7 |
| -import org.springframework.web.bind.annotation.GetMapping |
8 |
| -import org.springframework.web.bind.annotation.RequestMapping |
9 |
| -import org.springframework.web.bind.annotation.RestController |
10 |
| - |
11 |
| -@RestController |
12 |
| -@RequestMapping("/api/github/auth") |
13 |
| -class GithubAuthenticationController( |
14 |
| - val userService: UserService, |
15 |
| -) { |
16 |
| - @GetMapping |
17 |
| - fun githubAuth(): String { |
18 |
| - return "redirect:/oauth2/authorization/github" |
19 |
| - } |
20 |
| - |
21 |
| - @GetMapping("/authenticated/") |
22 |
| - fun getGithubUserInfo( |
23 |
| - @AuthenticationPrincipal oAuth2User: OAuth2User, |
24 |
| - ): TokenResponse { |
25 |
| - return userService.execute(oAuth2User) |
26 |
| - } |
27 |
| - |
28 |
| - @GetMapping("/not/authenticated/") |
29 |
| - fun notAuthenticated(): String { |
30 |
| - return "Not authenticated" |
31 |
| - } |
32 |
| -} |
| 1 | +//package entry.dsm.gitauth.equusgithubauth.domain.auth.presentation.controller |
| 2 | +// |
| 3 | +//import entry.dsm.gitauth.equusgithubauth.domain.user.presentation.dto.response.TokenResponse |
| 4 | +//import org.springframework.security.core.annotation.AuthenticationPrincipal |
| 5 | +//import org.springframework.security.oauth2.core.user.OAuth2User |
| 6 | +//import org.springframework.web.bind.annotation.GetMapping |
| 7 | +//import org.springframework.web.bind.annotation.RequestMapping |
| 8 | +//import org.springframework.web.bind.annotation.RestController |
| 9 | +// |
| 10 | +//@RestController |
| 11 | +//@RequestMapping("/api/github/auth") |
| 12 | +//class GithubAuthenticationController( |
| 13 | +// val userService: UserService, |
| 14 | +//) { |
| 15 | +// @GetMapping |
| 16 | +// fun githubAuth(): String { |
| 17 | +// return "redirect:/oauth2/authorization/github" |
| 18 | +// } |
| 19 | +// |
| 20 | +// @GetMapping("/authenticated/") |
| 21 | +// fun getGithubUserInfo( |
| 22 | +// @AuthenticationPrincipal oAuth2User: OAuth2User, |
| 23 | +// ): TokenResponse { |
| 24 | +// return userService.execute(oAuth2User) |
| 25 | +// } |
| 26 | +// |
| 27 | +// @GetMapping("/not/authenticated/") |
| 28 | +// fun notAuthenticated(): String { |
| 29 | +// return "Not authenticated" |
| 30 | +// } |
| 31 | +//} |
0 commit comments