Commit 8bc5d7bc by Bogdan Andjelkovic

security updateovi

parent ad3b8e25
...@@ -41,7 +41,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter ...@@ -41,7 +41,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests() http.authorizeRequests()
.antMatchers("/profile/**","/moji-oglasi/**","/login-zahtev/**","/lista-korisnika","/novi-oglas/**").authenticated() .antMatchers("/profile/**","/login-zahtev/**","/lista-korisnika","/novi-oglas/**","/lajkuj-oglas/**").authenticated()
.anyRequest().permitAll() .anyRequest().permitAll()
.and().formLogin().loginPage("/login").permitAll() .and().formLogin().loginPage("/login").permitAll()
.usernameParameter("email") .usernameParameter("email")
......
...@@ -85,7 +85,7 @@ public class AppController ...@@ -85,7 +85,7 @@ public class AppController
public String getChat(Model model,@AuthenticationPrincipal KorisnikDetails loggedUser, @RequestParam("email") String email) public String getChat(Model model,@AuthenticationPrincipal KorisnikDetails loggedUser, @RequestParam("email") String email)
{ {
if( loggedUser == null) if( loggedUser == null)
return "redirect:/moji-zahtevi"; return "redirect:/login";
model.addAttribute("loggedUser",loggedUser); model.addAttribute("loggedUser",loggedUser);
model.addAttribute("sagovornik",kRepo.findByEmail( email)); model.addAttribute("sagovornik",kRepo.findByEmail( email));
return "chat"; return "chat";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment