From 149e4c158ae873f35c5aba6f0db7a2e507516327 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sat, 23 Nov 2024 11:51:15 +0100 Subject: [PATCH] fix: /.well-known/change-password redirect works again --- .../io/papermc/hangar/controller/WellKnownController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/papermc/hangar/controller/WellKnownController.java b/backend/src/main/java/io/papermc/hangar/controller/WellKnownController.java index bbf0201b..a498e778 100644 --- a/backend/src/main/java/io/papermc/hangar/controller/WellKnownController.java +++ b/backend/src/main/java/io/papermc/hangar/controller/WellKnownController.java @@ -3,19 +3,19 @@ package io.papermc.hangar.controller; 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 changePassword() { + return ResponseEntity.status(301).header("location", "/auth/settings/account").build(); } @GetMapping(path = "/security.txt", produces = MediaType.TEXT_PLAIN_VALUE)