chore: sign in with provider (#3592)

* chore: sign in with provider

* feat: implement oauth flow of appflowy cloud

* chore: rename env

* chore: fix deadlock

* fix: login bugs

* chore: clippyt

* chore: update client api

* chore: fmt
This commit is contained in:
Nathan.fooo
2023-10-07 09:58:44 +08:00
committed by GitHub
parent 92523321f1
commit a59561aee3
45 changed files with 709 additions and 357 deletions

View File

@ -253,6 +253,9 @@ pub enum ErrorCode {
#[error("Permission denied")]
NotEnoughPermissions = 83,
#[error("Internal server error")]
InternalServerError = 84,
}
impl ErrorCode {

View File

@ -99,6 +99,7 @@ impl FlowyError {
ErrorCode::UnexpectedCalendarFieldType
);
static_flowy_error!(collab_not_sync, ErrorCode::CollabDataNotSync);
static_flowy_error!(server_error, ErrorCode::InternalServerError);
}
impl std::convert::From<ErrorCode> for FlowyError {

View File

@ -8,12 +8,12 @@ impl From<AppError> for FlowyError {
client_api::error::ErrorCode::Ok => ErrorCode::Internal,
client_api::error::ErrorCode::Unhandled => ErrorCode::Internal,
client_api::error::ErrorCode::RecordNotFound => ErrorCode::RecordNotFound,
client_api::error::ErrorCode::FileNotFound => ErrorCode::RecordNotFound,
client_api::error::ErrorCode::RecordAlreadyExists => ErrorCode::RecordAlreadyExists,
client_api::error::ErrorCode::InvalidEmail => ErrorCode::EmailFormatInvalid,
client_api::error::ErrorCode::InvalidPassword => ErrorCode::PasswordFormatInvalid,
client_api::error::ErrorCode::OAuthError => ErrorCode::UserUnauthorized,
client_api::error::ErrorCode::MissingPayload => ErrorCode::MissingPayload,
client_api::error::ErrorCode::StorageError => ErrorCode::Internal,
client_api::error::ErrorCode::OpenError => ErrorCode::Internal,
client_api::error::ErrorCode::InvalidUrl => ErrorCode::InvalidURL,
client_api::error::ErrorCode::InvalidRequestParams => ErrorCode::InvalidParams,