diff --git a/plugin/grails-app/controllers/grails/plugin/springsecurity/ui/RegisterController.groovy b/plugin/grails-app/controllers/grails/plugin/springsecurity/ui/RegisterController.groovy index 6762ce01..af42a9b2 100644 --- a/plugin/grails-app/controllers/grails/plugin/springsecurity/ui/RegisterController.groovy +++ b/plugin/grails-app/controllers/grails/plugin/springsecurity/ui/RegisterController.groovy @@ -14,6 +14,8 @@ */ package grails.plugin.springsecurity.ui +import grails.config.Config +import grails.core.support.GrailsConfigurationAware import grails.plugin.springsecurity.authentication.dao.NullSaltSource import grails.plugin.springsecurity.ui.strategy.MailStrategy import grails.plugin.springsecurity.ui.strategy.PropertiesStrategy @@ -25,7 +27,7 @@ import org.springframework.security.authentication.dao.SaltSource /** * @author Burt Beckwith */ -class RegisterController extends AbstractS2UiController { +class RegisterController extends AbstractS2UiController implements GrailsConfigurationAware { static defaultAction = 'register' @@ -41,6 +43,13 @@ class RegisterController extends AbstractS2UiController { /** Dependency injection for the 'uiPropertiesStrategy' bean. */ PropertiesStrategy uiPropertiesStrategy + String serverURL + + @Override + void setConfiguration(Config co) { + serverURL = co.getProperty('grails.serverURL', String) + } + def register(RegisterCommand registerCommand) { if (!request.post) { @@ -188,8 +197,8 @@ class RegisterController extends AbstractS2UiController { protected String generateLink(String action, Map linkParams, boolean shouldUseServerUrl = false) { String base = "$request.scheme://$request.serverName:$request.serverPort$request.contextPath" - if (shouldUseServerUrl && Holders.config.grails.serverURL) { - base = grailsApplication.config.grails.serverURL + if (shouldUseServerUrl && serverURL) { + base = serverURL } createLink(