grails / grails-spring-security-core

Grails Spring Security Core Plugin
Apache License 2.0
259 stars 223 forks source link

Switch user targetUrl config to redirect after login/logout #804

Open richardvil opened 1 year ago

richardvil commented 1 year ago

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.

matrei commented 8 months ago

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

richardvil commented 7 months ago

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.