Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form th:action="@{/login}" th:object="${user}" method="post" role="login">
- <h2 class="text-center" th:text="${companyName}"></h2>
- <input type="email" id="username" name="username" autocomplete="username" th:placeholder="|Email@${clientEmailDomain}|" required class="form-control input-lg" />
- <input type="password" class="form-control input-lg" id="password" name="password" autocomplete="current-password" placeholder="Password" required="" />
- <button type="submit" class="btn btn-lg btn-primary btn-block">Log in</button>
- </form>
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http
- .authorizeRequests()
- .antMatchers("/",
- "/css/**",
- "/fonts/**",
- "/img/**",
- "/js/**",
- "/register",
- "/resetPassword",
- ).permitAll()
- .anyRequest().authenticated()
- .and()
- .formLogin()
- .loginPage("/login")
- .defaultSuccessUrl("/search/" + clientOsVersion)
- .permitAll()
- .and()
- .logout()
- .permitAll();
- // THIS IS ONLY DURING DEV to access to the database
- http.csrf().disable();
- http.headers().frameOptions().disable();
- // END OF DEV ONLY
- }
- @PostMapping("/login")
- public ModelAndView processLoginForm(ModelAndView modelAndView,
- @Valid User user
- ) {
- System.err.println("Processing login data"); // This line is NEVER printed!!!
- // Here I need to update a user's attribute.
- modelAndView.addObject("clientEmailDomain",
- clientEmailDomain);
- modelAndView.addObject("companyName",
- companyName);
- return modelaAndView;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement