This repository was archived by the owner on Oct 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
main/scala/com/softwaremill/session
test/scala/com/softwaremill/session Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ trait RefreshableSessionDirectives { this: OneOffSessionDirectives =>
172172 onSuccess(sc.refreshTokenManager.sessionFromValue(v))
173173 .flatMap {
174174 case s @ SessionResult .CreatedFromToken (session) =>
175- setRefreshToken (sc, setSt, session) & provide(s : SessionResult [T ])
175+ setRefreshableSession (sc, setSt, session) & provide(s : SessionResult [T ])
176176 case s => provide(s)
177177 }
178178 }
Original file line number Diff line number Diff line change @@ -106,6 +106,23 @@ class RefreshableTest extends FlatSpec with ScalatestRouteTest with Matchers wit
106106 }
107107 }
108108
109+ p should " set a new session after the session is re-created" in {
110+ Get (" /set" ) ~> routes ~> check {
111+ val Some (token1) = using.getRefreshToken
112+ val session1 = using.getSession
113+ session1 should be(' defined )
114+
115+ Get (" /getOpt" ) ~>
116+ addHeader(using.setRefreshTokenHeader(token1)) ~>
117+ routes ~>
118+ check {
119+ val session2 = using.getSession
120+ session2 should be(' defined )
121+ session2 should not be (session1)
122+ }
123+ }
124+ }
125+
109126 p should " read an optional session when none is set" in {
110127 Get (" /getOpt" ) ~> routes ~> check {
111128 responseAs[String ] should be(" None" )
You can’t perform that action at this time.
0 commit comments