mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-02 16:25:36 +02:00
Change HTTP code returned for routes rejected in reverse proxy setup
This commit is contained in:
parent
39bbc8c134
commit
ee02fb5d92
@ -20,7 +20,7 @@ class RejectIfReverseProxy
|
|||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => __('errors.unsupported_with_reverseproxy'),
|
'message' => __('errors.unsupported_with_reverseproxy'),
|
||||||
], 400);
|
], 405);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
@ -46,8 +46,8 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if( error.response.status === 400 ) {
|
if( error.response.status === 405 ) {
|
||||||
// The backend returns a 400 response for routes with the
|
// The backend returns a 405 response for routes with the
|
||||||
// rejectIfReverseProxy middleware
|
// rejectIfReverseProxy middleware
|
||||||
isRemoteUser.value = true
|
isRemoteUser.value = true
|
||||||
}
|
}
|
||||||
|
@ -94,8 +94,8 @@
|
|||||||
credentials.value = response.data
|
credentials.value = response.data
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if( error.response.status === 400 ) {
|
if( error.response.status === 405 ) {
|
||||||
// The backend returns a 400 response for routes with the
|
// The backend returns a 405 response for routes with the
|
||||||
// rejectIfReverseProxy middleware
|
// rejectIfReverseProxy middleware
|
||||||
isRemoteUser.value = true
|
isRemoteUser.value = true
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ class WebAuthnManageControllerTest extends FeatureTestCase
|
|||||||
{
|
{
|
||||||
$response = $this->actingAs($this->user, 'reverse-proxy-guard')
|
$response = $this->actingAs($this->user, 'reverse-proxy-guard')
|
||||||
->json('GET', '/webauthn/credentials')
|
->json('GET', '/webauthn/credentials')
|
||||||
->assertStatus(400);
|
->assertStatus(405);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,7 +146,7 @@ class WebAuthnManageControllerTest extends FeatureTestCase
|
|||||||
{
|
{
|
||||||
$response = $this->actingAs($this->user, 'reverse-proxy-guard')
|
$response = $this->actingAs($this->user, 'reverse-proxy-guard')
|
||||||
->json('PATCH', '/webauthn/credentials/fqsdfqsdf/name')
|
->json('PATCH', '/webauthn/credentials/fqsdfqsdf/name')
|
||||||
->assertStatus(400);
|
->assertStatus(405);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,7 +156,7 @@ class WebAuthnManageControllerTest extends FeatureTestCase
|
|||||||
{
|
{
|
||||||
$response = $this->actingAs($this->user, 'reverse-proxy-guard')
|
$response = $this->actingAs($this->user, 'reverse-proxy-guard')
|
||||||
->json('DELETE', '/webauthn/credentials/dcnskldjnkljsrn')
|
->json('DELETE', '/webauthn/credentials/dcnskldjnkljsrn')
|
||||||
->assertStatus(400);
|
->assertStatus(405);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user