mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-12-21 06:51:19 +08:00
fix: /.well-known/change-password redirect works again
This commit is contained in:
parent
2a97934a27
commit
149e4c158a
@ -3,19 +3,19 @@ package io.papermc.hangar.controller;
|
|||||||
import io.papermc.hangar.HangarComponent;
|
import io.papermc.hangar.HangarComponent;
|
||||||
import io.papermc.hangar.security.annotations.Anyone;
|
import io.papermc.hangar.security.annotations.Anyone;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
|
|
||||||
@Anyone
|
@Anyone
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/.well-known")
|
@RequestMapping("/.well-known")
|
||||||
public class WellKnownController extends HangarComponent {
|
public class WellKnownController extends HangarComponent {
|
||||||
|
|
||||||
@GetMapping(path = "/change-password", produces = MediaType.TEXT_PLAIN_VALUE)
|
@GetMapping(path = "/change-password")
|
||||||
public ModelAndView changePassword() {
|
public ResponseEntity<Object> changePassword() {
|
||||||
return new ModelAndView("redirect:/auth/settings/account");
|
return ResponseEntity.status(301).header("location", "/auth/settings/account").build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/security.txt", produces = MediaType.TEXT_PLAIN_VALUE)
|
@GetMapping(path = "/security.txt", produces = MediaType.TEXT_PLAIN_VALUE)
|
||||||
|
Loading…
Reference in New Issue
Block a user