Commit 86a1440b authored by Khalid Ali's avatar Khalid Ali
Browse files

Fixed logout redirect

parent 34f22b25
...@@ -106,7 +106,7 @@ public class BookshareApplication { ...@@ -106,7 +106,7 @@ public class BookshareApplication {
@Bean @Bean
public SingleSignOutFilter singleSignOutFilter() { public SingleSignOutFilter singleSignOutFilter() {
SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter(); SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter();
singleSignOutFilter.setCasServerUrlPrefix("https://localhost:9443/"); singleSignOutFilter.setCasServerUrlPrefix("https://localhost:9443");
singleSignOutFilter.setIgnoreInitConfiguration(true); singleSignOutFilter.setIgnoreInitConfiguration(true);
return singleSignOutFilter; return singleSignOutFilter;
} }
......
...@@ -51,7 +51,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -51,7 +51,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.httpBasic() .httpBasic()
.authenticationEntryPoint(authenticationEntryPoint) .authenticationEntryPoint(authenticationEntryPoint)
.and() .and()
.logout().logoutSuccessUrl("/logout") .logout().logoutSuccessUrl("/bs/api/logout")
.and() .and()
.addFilterBefore(singleSignOutFilter, CasAuthenticationFilter.class) .addFilterBefore(singleSignOutFilter, CasAuthenticationFilter.class)
.addFilterBefore(logoutFilter, LogoutFilter.class); .addFilterBefore(logoutFilter, LogoutFilter.class);
......
...@@ -45,7 +45,7 @@ public class BookshareApiController { ...@@ -45,7 +45,7 @@ public class BookshareApiController {
this.shareUserService = shareUserService; this.shareUserService = shareUserService;
} }
@GetMapping(value = "/listing/", produces = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value = "/listing", produces = MediaType.APPLICATION_JSON_VALUE)
public List<ListingDto> getListings() { public List<ListingDto> getListings() {
List<ListingEntity> listings = listingService.getAll(); List<ListingEntity> listings = listingService.getAll();
return listings.stream() return listings.stream()
...@@ -53,7 +53,7 @@ public class BookshareApiController { ...@@ -53,7 +53,7 @@ public class BookshareApiController {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
@PostMapping(value = "/listing/", consumes = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/listing", consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public ListingDto newListing(@RequestBody ListingDto listingDto) { public ListingDto newListing(@RequestBody ListingDto listingDto) {
ListingEntity post = convertToEntity(listingDto); ListingEntity post = convertToEntity(listingDto);
...@@ -82,7 +82,7 @@ public class BookshareApiController { ...@@ -82,7 +82,7 @@ public class BookshareApiController {
listingService.deleteListing(id); listingService.deleteListing(id);
} }
@GetMapping(value = "/listing/{id}/bid/") @GetMapping(value = "/listing/{id}/bid")
List<BidDto> getBidsAssociatedWithListing(@PathVariable Long id) { List<BidDto> getBidsAssociatedWithListing(@PathVariable Long id) {
ListingEntity listingEntity = listingService.getById(id); ListingEntity listingEntity = listingService.getById(id);
return listingEntity.getBids().stream() return listingEntity.getBids().stream()
...@@ -90,7 +90,7 @@ public class BookshareApiController { ...@@ -90,7 +90,7 @@ public class BookshareApiController {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
@PostMapping(value = "/listing/{id}/bid/") @PostMapping(value = "/listing/{id}/bid")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
public BidDto addBid(@PathVariable Long id, @RequestBody BidDto bidDto) { public BidDto addBid(@PathVariable Long id, @RequestBody BidDto bidDto) {
BidEntity bid = convertBidToEntity(bidDto); BidEntity bid = convertBidToEntity(bidDto);
......
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