mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
cleanup
This commit is contained in:
1 parent
269ae23932
commit
c6823064ba
1 file changed
+6
-6
+6
-6
@@ -202,14 +202,14 @@ impl From<RequireUserSessionError> for AdvancedCommonWebError {
|
||||
impl From<HttpUserSessionPayloadError> for AdvancedCommonWebError {
|
||||
fn from(value: HttpUserSessionPayloadError) -> Self {
|
||||
match &value {
|
||||
// Other JWT errors (verify failure, etc.) → 400 bad input.
|
||||
HttpUserSessionPayloadError::JwtSigner(JwtSignerError::JwtVerifyError(_)) => {
|
||||
Self::BadInputWithSimpleMessage("invalid session".to_string())
|
||||
}
|
||||
// Client HTTP header errors → 400 bad input.
|
||||
HttpUserSessionPayloadError::HttpSessionHeaderError(_) => {
|
||||
Self::BadInputWithSimpleMessage("invalid session".to_string())
|
||||
}
|
||||
// JWT verify errors (eg. forged cookies) → 400 bad input.
|
||||
HttpUserSessionPayloadError::JwtSigner(JwtSignerError::JwtVerifyError(_)) => {
|
||||
Self::BadInputWithSimpleMessage("invalid session".to_string())
|
||||
}
|
||||
// Server-side JWT signer failures (bad HMAC config, signing failure) → 500.
|
||||
HttpUserSessionPayloadError::JwtSigner(
|
||||
JwtSignerError::JwtInvalidKeyLength
|
||||
@@ -224,11 +224,11 @@ impl From<HttpUserSessionPayloadError> for AdvancedCommonWebError {
|
||||
impl From<AvtCookiePayloadError> for AdvancedCommonWebError {
|
||||
fn from(err: AvtCookiePayloadError) -> Self {
|
||||
match &err {
|
||||
// JWT verify errors → 400 bad input.
|
||||
// JWT verify errors (eg. forged cookies) → 400 bad input.
|
||||
AvtCookiePayloadError::JwtSigner(JwtSignerError::JwtVerifyError(_)) => {
|
||||
Self::BadInputWithSimpleMessage("invalid AVT cookie".to_string())
|
||||
}
|
||||
// Server-side JWT signer failures → 500.
|
||||
// Server-side JWT signer failures (bad HMAC config, signing failure) → 500.
|
||||
AvtCookiePayloadError::JwtSigner(
|
||||
JwtSignerError::JwtInvalidKeyLength
|
||||
| JwtSignerError::JwtSignError(_),
|
||||
|
||||
Reference in new issue
Block a user