Changeset 1770
- Timestamp:
- Apr 13, 2011, 2:57:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/authentication/LoginController.groovy
r1671 r1770 12 12 import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter 13 13 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter 14 import org.codehaus.groovy.grails.commons.ConfigurationHolder 14 15 15 16 class LoginController { … … 67 68 def consumer = params.consumer 68 69 def token = params.token 69 70 70 71 if (consumer == null || token == null) { 71 72 throw new Exception("Consumer and Token must be given!"); 72 73 } 73 74 74 def returnUrl = params.returnUrl 75 def returnUrl; 76 77 // If no returnUrl is given, find the previous one from the session 78 if( params.returnUrl ) { 79 returnUrl = params.returnUrl; 80 session.authRemoteUrl = returnUrl; 81 } else if( session.authRemoteUrl ) { 82 returnUrl = session.authRemoteUrl; 83 } 75 84 76 85 // If the user is already authenticated with this session_id, redirect … … 100 109 String view = 'auth' 101 110 String postUrl = "${request.contextPath}${config.apf.filterProcessesUrl}" 102 String redirectUrl = g.createLink(controller: 'login', action: 'auth_remote', params: [consumer: params.consumer, token: params.token, returnUrl: params.returnUrl], absolute: true) 111 112 String redirectUrl = g.createLink(controller: 'login', action: 'auth_remote', params: [consumer: params.consumer, token: params.token], absolute: true) 103 113 render view: view, model: [postUrl: postUrl, 104 114 rememberMeParameter: config.rememberMe.parameter, redirectUrl: redirectUrl]
Note: See TracChangeset
for help on using the changeset viewer.