Changeset 1770


Ignore:
Timestamp:
Apr 13, 2011, 2:57:42 PM (6 years ago)
Author:
robert@…
Message:

Improved logging in from modules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/authentication/LoginController.groovy

    r1671 r1770  
    1212import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
    1313import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
     14import org.codehaus.groovy.grails.commons.ConfigurationHolder
    1415
    1516class LoginController {
     
    6768                def consumer = params.consumer
    6869                def token = params.token
    69 
     70               
    7071                if (consumer == null || token == null) {
    7172                        throw new Exception("Consumer and Token must be given!");
    7273                }
    7374
    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                }
    7584
    7685                // If the user is already authenticated with this session_id, redirect
     
    100109                String view = 'auth'
    101110                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)
    103113                render view: view, model: [postUrl: postUrl,
    104114                        rememberMeParameter: config.rememberMe.parameter, redirectUrl: redirectUrl]
Note: See TracChangeset for help on using the changeset viewer.