forked from SteamWar/SteamWar
Add password reset URL generation and backend validation
This commit is contained in:
@@ -31,7 +31,6 @@ import de.steamwar.util.type
|
||||
import io.ktor.http.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.auth.*
|
||||
import io.ktor.server.http.*
|
||||
import io.ktor.server.plugins.*
|
||||
import io.ktor.server.request.*
|
||||
import io.ktor.server.response.*
|
||||
@@ -64,7 +63,7 @@ fun Route.configureNewAuth() {
|
||||
route("/auth") {
|
||||
route("/enroll") {
|
||||
post("/{userId}") {
|
||||
if (call.request.headers.contains("X-Forwarded-For")) {
|
||||
if (call.request.headers.contains("X-Forwarded-For") || call.request.header("Host") != "localhost:1337") {
|
||||
SWException.log("Request to /auth/register from", "Invalid IP")
|
||||
call.respond(HttpStatusCode.Forbidden, ResponseError("Invalid IP", "F_U"))
|
||||
return@post
|
||||
|
||||
Reference in New Issue
Block a user