|
|
@ -5,12 +5,15 @@ import app.utils.SaltedCookie; |
|
|
|
import jakarta.servlet.http.Cookie; |
|
|
|
import jakarta.servlet.http.HttpServletResponse; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.HttpHeaders; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
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.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.net.URI; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@RestController |
|
|
@ -53,12 +56,15 @@ public class AuthController { |
|
|
|
|
|
|
|
Cookie cookie_steam64 = new Cookie("steam64", steam64.toString()); |
|
|
|
cookie_steam64.setPath("/"); |
|
|
|
cookie_steam64.setDomain("tf2.pblr-nyk.pro"); |
|
|
|
response.addCookie(cookie_steam64); |
|
|
|
Cookie cookie_steam64_secured = new Cookie("steam64_secured", saltedCookie.Hashed(steam64.toString())); |
|
|
|
cookie_steam64_secured.setPath("/"); |
|
|
|
cookie_steam64_secured.setDomain("tf2.pblr-nyk.pro"); |
|
|
|
response.addCookie(cookie_steam64_secured); |
|
|
|
|
|
|
|
return ResponseEntity.ok() |
|
|
|
.body("login successful"); |
|
|
|
return ResponseEntity.status(HttpStatus.FOUND). |
|
|
|
header("Location", "/") |
|
|
|
.build(); |
|
|
|
} |
|
|
|
} |
|
|
|