spring security redirects to last requested page after login session timeout

前端 未结 2 1653
盖世英雄少女心
盖世英雄少女心 2021-02-09 18:05

I have implemented spring security for login to my web portal. It works fine except for one issue. I have set session timeout to 5 min. Once timeout happpens and then user click

相关标签:
2条回答
  • 2021-02-09 18:22

    Add the always-use-default-target attribute to your form-login tag.

    <form-login always-use-default-target="true" />
    

    If set to true, the user will always start at the value given by default-target-url, regardless of how they arrived at the login page. Maps to the alwaysUseDefaultTargetUrl property of UsernamePasswordAuthenticationFilter. Default value is false.

    0 讨论(0)
  • 2021-02-09 18:23

    In Grails, this setting solves the problem in Config.groovy

    grails.plugin.springsecurity.successHandler.alwaysUseDefault = true
    
    0 讨论(0)
提交回复
热议问题