grails-spring-security-core icon indicating copy to clipboard operation
grails-spring-security-core copied to clipboard

Switch user targetUrl config to redirect after login/logout

Open richardvil opened this issue 3 years ago • 3 comments

Feature description

Hi, I was wondering if it's possible to add two new parameters to set a targetUrl to redirect after login and logout. Something like:

grails.plugin.springsecurity.switchUser.afterLoginTargetUrl grails.plugin.springsecurity.switchUser.afterLogoutTargetUrl

This configurations are only to customize that behaviour, otherwise the plugin takes the value of: grails.plugin.springsecurity.switchUser.targetUrl

If it's possible, just point me the right direction and I will make a PR.

richardvil avatar Nov 04 '22 21:11 richardvil

@richardvil Does not grails.plugin.springsecurity.successHandler.defaultTargetUrl and grails.plugin.springsecurity.logout.afterLogoutUrl do the job?

matrei avatar Nov 07 '23 10:11 matrei

I didn't realize of the switchUser.targetUrl configuration, but it would be nice something similar for the logout, because the grails.plugin.springsecurity.logout.afterLogoutUrl doesn't works.

richardvil avatar Dec 08 '23 20:12 richardvil