Skip to content

Commit

Permalink
Make the getSurveyById endpoint accessible without authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarjanazy committed May 31, 2020
1 parent 1380472 commit ab45671
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected void configure(HttpSecurity http) throws Exception {
.cors()
.and()
.csrf().disable()
.authorizeRequests().antMatchers("/authenticate", "/h2-console/**", "/signUp", "/submitSurvey").permitAll()
.authorizeRequests().antMatchers("/authenticate", "/h2-console/**", "/signUp", "/submitSurvey", "/survey").permitAll()
.antMatchers("/admin/**").hasRole("ADMIN")
.anyRequest().authenticated()
.and().sessionManagement()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ List<Survey> getSurveysByUserId(Integer userId){


public ResponseEntity<?> getSurveyById(Integer surveyId){
if(verificationService.notUserSurvey(surveyId)){
return ResponseEntity.badRequest().build();
}
return surveyServiceAdmin.getSurveyById(surveyId);
}
public ResponseEntity<?> checkAndAddSurvey(Survey survey){
Expand Down

0 comments on commit ab45671

Please sign in to comment.