source: trunk/grails-app/controllers/dbnp/authentication/LogoutController.groovy @ 1036

Last change on this file since 1036 was 1036, checked in by robert@…, 12 years ago

Fixed the random order of templates in the study pages (#135) and created a remote logout call (#158).

File size: 1.4 KB
Line 
1package dbnp.authentication
2
3import org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils
4
5class LogoutController {
6
7        /**
8         * Index action. Redirects to the Spring security logout uri.
9         */
10        def index = {
11                if( params[ SpringSecurityUtils.securityConfig.successHandler.targetUrlParameter ] ) {
12                        redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl + "?" + SpringSecurityUtils.securityConfig.successHandler.targetUrlParameter + '=' + params[ SpringSecurityUtils.securityConfig.successHandler.targetUrlParameter ] // '/j_spring_security_logout'
13                } else {
14                        redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl // '/j_spring_security_logout'
15                }
16                // TODO  put any pre-logout code here
17        }
18
19        def remote = {
20                // Log out the remote user
21                AuthenticationService.logOffRemotely( params.consumer, params.token )
22               
23                // Try to rest the redirect url
24                if( params[ SpringSecurityUtils.securityConfig.successHandler.targetUrlParameter ] ) {
25                        redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl + "?" + SpringSecurityUtils.securityConfig.successHandler.targetUrlParameter + '=' + params[ SpringSecurityUtils.securityConfig.successHandler.targetUrlParameter ] // '/j_spring_security_logout'
26                } else {
27                        redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl // '/j_spring_security_logout'
28                }
29        }
30}
Note: See TracBrowser for help on using the repository browser.