Skip to content

Commit

Permalink
fix: /.well-known/change-password redirect works again
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Nov 23, 2024
1 parent 2a97934 commit 149e4c1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
import io.papermc.hangar.HangarComponent;
import io.papermc.hangar.security.annotations.Anyone;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@Anyone
@RestController
@RequestMapping("/.well-known")
public class WellKnownController extends HangarComponent {

@GetMapping(path = "/change-password", produces = MediaType.TEXT_PLAIN_VALUE)
public ModelAndView changePassword() {
return new ModelAndView("redirect:/auth/settings/account");
@GetMapping(path = "/change-password")
public ResponseEntity<Object> changePassword() {
return ResponseEntity.status(301).header("location", "/auth/settings/account").build();
}

@GetMapping(path = "/security.txt", produces = MediaType.TEXT_PLAIN_VALUE)
Expand Down

0 comments on commit 149e4c1

Please sign in to comment.