Skip to content

Commit

Permalink
sending certain onedrive errors to the user
Browse files Browse the repository at this point in the history
this is useful because:

      // onedrive gives some errors here that the user might want to know about
      // e.g. these happen if you try to login to a users in an organization,
      // without an Office365 licence or OneDrive account setup completed
      // 400: Tenant does not have a SPO license
      // 403: You do not have access to create this personal site or you do not have a valid license
  • Loading branch information
mifi committed Sep 6, 2023
1 parent a28fcec commit fd572a6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ class OneDrive extends Provider {
tag,
providerName: this.authProvider,
isAuthError: (response) => response.statusCode === 401,
isUserFacingError: (response) => [400, 403].includes(response.statusCode),
// onedrive gives some errors here that the user might want to know about
// e.g. these happen if you try to login to a users in an organization,
// without an Office365 licence or OneDrive account setup completed
// 400: Tenant does not have a SPO license
// 403: You do not have access to create this personal site or you do not have a valid license
getJsonErrorMessage: (body) => body?.error?.message,
})
}
Expand Down

0 comments on commit fd572a6

Please sign in to comment.