我正在实现这样的登录表单:
<form action="${postUrl ?: '/login/auth'}" method="POST" id="loginForm" class="cssform" autocomplete="off">
<p>Por favor ingrese sus credenciales:</p>
<div class="form-group" style="color: #2C3E50 ">
<input type="text" name="${usernameParameter ?: 'username'}" id="username" class="form-control input-lg" placeholder="Usuario" required="">
</div>
<div class="form-group" style="color: #2C3E50">
<input type="password" name="${passwordParameter ?: 'password'}" id="password" class="form-control input-lg" placeholder="Contraseña" required="">
</div>
<p id="remember_me_holder">
<input type="checkbox" class="i-checks" name="${rememberMeParameter ?: 'remember-me'}" id="remember_me">
<label> Recuérdame</label>
</p>
<div class="btn-h">
<button type="submit" class="btn btn-azul btn-lg block full-width m-b" id="submit" value='${message(code: 'springSecurity.login.button')}' title="Ingresar al sistema SIIDE-DGAPA">
<i class="fa fa-sign-in"> </i> Iniciar sesión
</button>
</div>
</form>
身份验证工作正常,但登录后,将我重定向到auth.html
页面,我希望发送到index.gsp
答案 0 :(得分:1)
您可以更改此网址:
application.yml:
grails:
plugin:
springsecurity:
successHandler:
defaultTargetUrl: "/pathToRedirectAfterLogin"
alwaysUseDefault: true
Grails Spring Security插件功能非常强大。有大量不同的设置。阅读文档:http://grails-plugins.github.io/grails-spring-security-core/
答案 1 :(得分:0)