feat: allow connecting to ws via oauth2
This commit is contained in:
@@ -78,6 +78,9 @@ impl IntoResponse for Error {
|
||||
ErrorType::InvalidFlagValue => StatusCode::BAD_REQUEST,
|
||||
ErrorType::FeatureDisabled { .. } => StatusCode::BAD_REQUEST,
|
||||
|
||||
ErrorType::MissingScope { .. } => StatusCode::UNAUTHORIZED,
|
||||
ErrorType::ExpiredToken => StatusCode::UNAUTHORIZED,
|
||||
|
||||
ErrorType::ProxyError => StatusCode::BAD_REQUEST,
|
||||
ErrorType::FileTooSmall => StatusCode::UNPROCESSABLE_ENTITY,
|
||||
ErrorType::FileTooLarge { .. } => StatusCode::UNPROCESSABLE_ENTITY,
|
||||
|
||||
@@ -168,6 +168,12 @@ pub enum ErrorType {
|
||||
ImageProcessingFailed,
|
||||
NoEmbedData,
|
||||
|
||||
// ? OAuth2 Errors
|
||||
ExpiredToken,
|
||||
MissingScope {
|
||||
scope: String
|
||||
},
|
||||
|
||||
// ? Legacy errors
|
||||
VosoUnavailable,
|
||||
|
||||
|
||||
@@ -84,6 +84,9 @@ impl<'r> Responder<'r, 'static> for Error {
|
||||
ErrorType::FailedValidation { .. } => Status::BadRequest,
|
||||
ErrorType::FeatureDisabled { .. } => Status::BadRequest,
|
||||
|
||||
ErrorType::MissingScope { .. } => Status::Unauthorized,
|
||||
ErrorType::ExpiredToken => Status::Unauthorized,
|
||||
|
||||
ErrorType::ProxyError => Status::BadRequest,
|
||||
ErrorType::FileTooSmall => Status::UnprocessableEntity,
|
||||
ErrorType::FileTooLarge { .. } => Status::UnprocessableEntity,
|
||||
|
||||
Reference in New Issue
Block a user