在grails中切换用户(Spring Security )时出错

hwamh0ep  于 2021-09-30  发布在  Java
关注(0)|答案(0)|浏览(185)

我在grails中创建了一个交换机用户功能

<form id="impersonateUser" action='${request.contextPath}/login/impersonate'method='POST'>
        <label for="switchusername">Switch to user:</label>
         <input type='text' name='username' id="switchusername" value="${dto.username}"/>
         <input type='submit' value='Switch User'/>
         </form>

每当我点击提交,它都会被重定向到它所在的同一页面
这是我的应用程序

这是logincontroller的身份验证方法

def auth() {

        ConfigObject conf = getConf()

        if (springSecurityService.isLoggedIn()) {
            redirect uri: conf.successHandler.defaultTargetUrl
            return
        }
      // rest of the code
      ..........
}

调试时,控制将转到if(springsecurityservice.isloggedin()),然后重新运行到redirectionhandler

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题