Changeset 1626
- Timestamp:
- Mar 11, 2011, 1:42:05 PM (10 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BaseFilters.groovy
r1615 r1626 46 46 session.removeAttribute('loggedInUser') 47 47 48 def returnURI = request.requestURL.toString().replace(".dispatch","").replace("/grails/","/") + '?' + request.queryString 49 48 50 // and redirect to login page 49 redirect(controller: 'login', action: 'auth' )51 redirect(controller: 'login', action: 'auth', params: [returnURI: returnURI, referer: request.getHeader('referer')] ) 50 52 } 51 53 } -
trunk/grails-app/controllers/dbnp/authentication/LoginController.groovy
r1614 r1626 14 14 15 15 class LoginController { 16 17 16 /** 18 17 * Dependency injection for the authenticationTrustResolver. … … 46 45 */ 47 46 def auth = { 48 49 47 def config = SpringSecurityUtils.securityConfig 50 51 48 if (springSecurityService.isLoggedIn()) { 52 redirect uri: config.successHandler.defaultTargetUrl 49 if (params.returnURI) { 50 // see basefilters 51 redirect uri: params.returnURI 52 } else { 53 redirect uri: config.successHandler.defaultTargetUrl 54 } 53 55 return 54 56 } … … 56 58 String view = 'auth' 57 59 String postUrl = "${request.contextPath}${config.apf.filterProcessesUrl}" 58 render view: view, model: [postUrl: postUrl, 59 rememberMeParameter: config.rememberMe.parameter] 60 render view: view, model: [postUrl: postUrl, rememberMeParameter: config.rememberMe.parameter] 60 61 } 61 62 … … 108 109 */ 109 110 def denied = { 111 println "denied" 110 112 if (springSecurityService.isLoggedIn() && 111 113 authenticationTrustResolver.isRememberMe(SCH.context?.authentication)) { … … 119 121 */ 120 122 def full = { 123 pritln "full" 121 124 def config = SpringSecurityUtils.securityConfig 122 125 render view: 'auth', params: params, … … 129 132 */ 130 133 def authfail = { 131 134 println "authfail" 132 135 def username = session[UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY] 133 136 String msg = '' … … 164 167 */ 165 168 def ajaxSuccess = { 169 println "ajaxsuccess" 166 170 render([success: true, username: springSecurityService.authentication.name] as JSON) 167 171 } … … 171 175 */ 172 176 def ajaxDenied = { 177 println "ajaxdenied" 173 178 render([error: 'access denied'] as JSON) 174 179 }
Note: See TracChangeset
for help on using the changeset viewer.