Skip to content

Commit e243a67

Browse files
committed
Fixed broken account linking
1 parent fb3149f commit e243a67

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

module-code/app/securesocial/controllers/ProviderController.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ trait BaseProviderController extends SecureSocial with I18nSupport {
103103
throw AuthenticationException()
104104
case flow: AuthenticationResult.NavigationFlow => Future.successful {
105105
redirectTo.map { url =>
106-
flow.result.addToSession(SecureSocial.OriginalUrlKey -> url)
106+
flow.result.withSession(flow.result.session + (SecureSocial.OriginalUrlKey -> url))
107107
} getOrElse flow.result
108108
}
109109
case authenticated: AuthenticationResult.Authenticated =>

module-code/app/securesocial/core/utils.scala

+1-12
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,5 @@ object utils {
3333
def startingAuthenticator[A](authenticator: Authenticator[A]) = authenticator.starting(r)
3434
def discardingAuthenticator[A](authenticator: Authenticator[A]) = authenticator.discarding(r)
3535
def touchingAuthenticator[A](authenticator: Authenticator[A]) = authenticator.touching(r)
36-
def addToSession(values: (String, String)*) = {
37-
val cookies = Cookies.fromCookieHeader(r.header.headers.get(HeaderNames.SET_COOKIE))
38-
val resultSession = Session.decodeFromCookie(cookies.get(Session.COOKIE_NAME))
39-
def addValues(list: List[(String, String)], session: Session): Session = {
40-
if (list.isEmpty) session else {
41-
val s = session + list.head
42-
addValues(list.tail, s)
43-
}
44-
}
45-
r.withSession(addValues(values.toList, resultSession))
46-
}
4736
}
48-
}
37+
}

0 commit comments

Comments
 (0)