Skip to content

Commit 970beba

Browse files
committed
Merge pull request jaliss#371 from paiou/issue-366
Handle onSignUpGoTo configuration when signupSkipLogin is enabled
2 parents b60d813 + 0612456 commit 970beba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ object Registration extends Controller {
7070
val onHandleStartSignUpGoTo = stringConfig("securesocial.onStartSignUpGoTo", RoutesHelper.login().url)
7171
/** The redirect target of the handleSignUp action. */
7272
val onHandleSignUpGoTo = stringConfig("securesocial.onSignUpGoTo", RoutesHelper.login().url)
73+
val onHandleSignUpGoToOpt = Play.current.configuration.getString("securesocial.onSignUpGoTo")
7374
/** The redirect target of the handleStartResetPassword action. */
7475
val onHandleStartResetPasswordGoTo = stringConfig("securesocial.onStartResetPasswordGoTo", RoutesHelper.login().url)
7576
/** The redirect target of the handleResetPassword action. */
@@ -242,7 +243,10 @@ object Registration extends Controller {
242243
}
243244
val eventSession = Events.fire(new SignUpEvent(user)).getOrElse(session)
244245
if ( UsernamePasswordProvider.signupSkipLogin ) {
245-
ProviderController.completeAuthentication(user, eventSession).flashing(Success -> Messages(SignUpDone))
246+
val authResult = ProviderController.completeAuthentication(user, eventSession).flashing(Success -> Messages(SignUpDone))
247+
onHandleSignUpGoToOpt.map { targetUrl =>
248+
authResult.withHeaders(LOCATION -> targetUrl)
249+
} getOrElse authResult
246250
} else {
247251
Redirect(onHandleSignUpGoTo).flashing(Success -> Messages(SignUpDone)).withSession(eventSession)
248252
}

0 commit comments

Comments
 (0)