Implement persistent session storage
Signed-off-by: Billy Brawner <billy@wbrawner.com>
This commit is contained in:
parent
5d7470a006
commit
4755b30a11
3 changed files with 13 additions and 0 deletions
4
pom.xml
4
pom.xml
|
@ -28,6 +28,10 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
|
|
|
@ -51,6 +51,13 @@ class UserController @Autowired constructor(
|
|||
return ResponseEntity.ok(UserResponse(getCurrentUser()!!))
|
||||
}
|
||||
|
||||
@GetMapping("/me", produces = [MediaType.APPLICATION_JSON_VALUE])
|
||||
@ApiOperation(value = "getProfile", nickname = "getProfile", tags = ["Users"])
|
||||
fun getProfile(): ResponseEntity<UserResponse> {
|
||||
val user = getCurrentUser()?: return ResponseEntity.status(401).build()
|
||||
return ResponseEntity.ok(UserResponse(user))
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@GetMapping("/search", produces = [MediaType.APPLICATION_JSON_VALUE])
|
||||
@ApiOperation(value = "searchUsers", nickname = "searchUsers", tags = ["Users"])
|
||||
|
|
|
@ -4,3 +4,5 @@ spring.datasource.username=budget
|
|||
spring.datasource.password=budget
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.profiles.active=prod
|
||||
spring.session.store-type=jdbc
|
||||
spring.session.jdbc.initialize-schema=always
|
||||
|
|
Loading…
Reference in a new issue