Skip to content

Commit

Permalink
fix(webserver): Return standard error code for unauthorized graphql a…
Browse files Browse the repository at this point in the history
…ccess (#1279)

* fix(webserver): Return standard error code for unauthorized graphql access

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
boxbeam and autofix-ci[bot] authored Jan 23, 2024
1 parent 77cbf1c commit 74830a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ee/tabby-webserver/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ pub enum CoreError {
impl<S: ScalarValue> IntoFieldError<S> for CoreError {
fn into_field_error(self) -> FieldError<S> {
match self {
Self::Unauthorized(msg) => FieldError::new(msg, graphql_value!("Unauthorized")),
Self::Unauthorized(msg) => {
FieldError::new(msg, graphql_value!({"code": "UNAUTHORIZED"}))
}
_ => self.into(),
}
}
Expand Down

0 comments on commit 74830a4

Please sign in to comment.