Skip to content

Commit

Permalink
fix: new user and invite id url
Browse files Browse the repository at this point in the history
  • Loading branch information
speed2exe committed Sep 13, 2024
1 parent 11cdc86 commit d508aac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/api/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use access_control::collab::CollabAccessControl;
use app_error::AppError;
use appflowy_collaborate::actix_ws::entities::ClientStreamMessage;
use appflowy_collaborate::indexer::IndexerProvider;
use authentication::jwt::{OptionalUserUuid, UserUuid};
use authentication::jwt::{Authorization, OptionalUserUuid, UserUuid};
use collab_rt_entity::realtime_proto::HttpRealtimeMessage;
use collab_rt_entity::RealtimeMessage;
use collab_rt_protocol::validate_encode_collab;
Expand All @@ -41,6 +41,7 @@ use crate::biz;
use crate::biz::collab::ops::{
get_user_favorite_folder_views, get_user_recent_folder_views, get_user_trash_folder_views,
};
use crate::biz::user::user_verify::verify_token;
use crate::biz::workspace;
use crate::biz::workspace::ops::{
create_comment_on_published_view, create_reaction_on_comment, get_comments_on_published_view,
Expand Down Expand Up @@ -333,10 +334,12 @@ async fn get_workspace_invite_by_id_handler(
}

async fn post_accept_workspace_invite_handler(
user_uuid: UserUuid,
auth: Authorization,
invite_id: web::Path<Uuid>,
state: Data<AppState>,
) -> Result<JsonAppResponse<()>> {
let _is_new = verify_token(&auth.token, state.as_ref()).await?;
let user_uuid = auth.uuid()?;
let invite_id = invite_id.into_inner();
// TODO(zack): insert a workspace member in the af_workspace_member by calling workspace::ops::add_workspace_members.
// Currently, when the server get restarted, the policy in access control will be lost.
Expand Down
2 changes: 1 addition & 1 deletion src/biz/workspace/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ pub async fn invite_workspace_members(
// Generate a link such that when clicked, the user is added to the workspace.
let accept_url = {
match appflowy_web_url {
Some(appflowy_web_url) => format!("{}/accept-invitation?invitated_id={}", appflowy_web_url, invite_id),
Some(appflowy_web_url) => format!("{}/accept-invitation?invited_id={}", appflowy_web_url, invite_id),
None => {
gotrue_client
.admin_generate_link(
Expand Down

0 comments on commit d508aac

Please sign in to comment.