I have set login endpointUrl in config.groovy as
grails.plugin.springsecurity.rest.login.endpointUrl = "/api/login"
How to access this endpointUrl values in your controller ?
I have set login endpointUrl in config.groovy as
grails.plugin.springsecurity.rest.login.endpointUrl = "/api/login"
How to access this endpointUrl values in your controller ?
In a controller you can use:
Holders.config.grails.plugin.springsecurity.rest.login.endpointUrl
Or:
grailsApplication.config.grails.plugin.springsecurity.rest.login.endpointUrl
See: This answer
Personally, I'm not a big fan of Holders because it makes your code a bit harder to test. Instead, I prefer to inject config to avoid having a dependency on the Holders class:
@Value('${grails.plugin.springsecurity.rest.login.endpointUrl}')
def endpointUrl