-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
124 additions
and
97 deletions.
There are no files selected for viewing
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
36 changes: 36 additions & 0 deletions
36
server/src/main/java/haengdong/common/auth/config/AuthConfig.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,36 @@ | ||
package haengdong.common.auth.config; | ||
|
||
import haengdong.common.auth.TokenProvider; | ||
import haengdong.common.auth.application.AuthService; | ||
import haengdong.common.auth.infrastructure.AuthenticationExtractor; | ||
import haengdong.common.auth.infrastructure.JwtTokenProvider; | ||
import haengdong.common.properties.JwtProperties; | ||
import haengdong.event.application.EventService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@RequiredArgsConstructor | ||
@EnableConfigurationProperties({JwtProperties.class}) | ||
@Configuration | ||
public class AuthConfig { | ||
|
||
private final JwtProperties jwtProperties; | ||
private final EventService eventService; | ||
|
||
@Bean | ||
public AuthService authService() { | ||
return new AuthService(tokenProvider(), eventService); | ||
} | ||
|
||
@Bean | ||
public TokenProvider tokenProvider() { | ||
return new JwtTokenProvider(jwtProperties); | ||
} | ||
|
||
@Bean | ||
public AuthenticationExtractor authenticationExtractor() { | ||
return new AuthenticationExtractor(); | ||
} | ||
} |
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
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
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
Oops, something went wrong.