Skip to content

Commit 0612456

Browse files
author
Nicolas Morin
committed
Handle onSignUpGoTo configuration when signupSkipLogin is enabled
1 parent f2fa2ee commit 0612456

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
@@ -69,6 +69,7 @@ object Registration extends Controller {
6969
val onHandleStartSignUpGoTo = stringConfig("securesocial.onStartSignUpGoTo", RoutesHelper.login().url)
7070
/** The redirect target of the handleSignUp action. */
7171
val onHandleSignUpGoTo = stringConfig("securesocial.onSignUpGoTo", RoutesHelper.login().url)
72+
val onHandleSignUpGoToOpt = Play.current.configuration.getString("securesocial.onSignUpGoTo")
7273
/** The redirect target of the handleStartResetPassword action. */
7374
val onHandleStartResetPasswordGoTo = stringConfig("securesocial.onStartResetPasswordGoTo", RoutesHelper.login().url)
7475
/** The redirect target of the handleResetPassword action. */
@@ -245,7 +246,10 @@ object Registration extends Controller {
245246
}
246247
val eventSession = Events.fire(new SignUpEvent(user)).getOrElse(session)
247248
if ( UsernamePasswordProvider.signupSkipLogin ) {
248-
ProviderController.completeAuthentication(user, eventSession).flashing(Success -> Messages(SignUpDone))
249+
val authResult = ProviderController.completeAuthentication(user, eventSession).flashing(Success -> Messages(SignUpDone))
250+
onHandleSignUpGoToOpt.map { targetUrl =>
251+
authResult.withHeaders(LOCATION -> targetUrl)
252+
} getOrElse authResult
249253
} else {
250254
Redirect(onHandleSignUpGoTo).flashing(Success -> Messages(SignUpDone)).withSession(eventSession)
251255
}

0 commit comments

Comments
 (0)