Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invitation #478

Open
bob2402 opened this issue Jun 6, 2024 · 0 comments
Open

Invitation #478

bob2402 opened this issue Jun 6, 2024 · 0 comments

Comments

@bob2402
Copy link
Collaborator

bob2402 commented Jun 6, 2024

A user who has joined Space can generate an invitation link. Then the user can share this link with others. Others can join Space by clicking on this link.

Invite Flow

graph TD;
  joined[Users who have joined the space] --> permission{invite permission?};
	permission -->|have| options[invite optionns];
	permission -->|haven't| none;
	options -->|expire time, limit count| url[send invite event and generate invite url];
	url --> onboarding[onboarding page with invite url];
	onboarding --> keyless[keyless user];
	onboarding --> not-logged[key user who is not logged in to the client];
	onboarding --> logged[key user who has logged in to the client];
	keyless --> generate[gennerate key];
	not-logged --> login[login to client];
	generate --> logged;
	login --> logged;
	logged --> join{Already joined?};
	join -->|yes| current[change current space to invited space];
	join -->|no| send[connect space with join event];
	send --> success{joining successful?};
	success -->|success| current;
  success -->|error| error[show error];
Loading

Optional

  • Permission to generate invitation links:admin, allow list and joined user(kind 1 allow list)
  • Invitation link options:expire time and limit count

URL

https://blowater.app/invite/[invite event id with hostnname]

The hostname or url is carried here so that the client knows which space to join

Invite Event

const inviteEvent = {
  id: "",
  sig: ""
  pubkey: "",
  kind: "invite"
  expired_on: "rfc3339 timestamp",
  limit_count: 5,
}

Join Event

const joinEvent = {
  id: "",
  sig: "",
  pubkey: "",
  kind: "join",
  invite_id: "invite event id",
}

Since there is currently no websocket connection, this event is included in the URL query when requesting a connection.

Revoke flow

Revoking the invitation invalidates the event, preventing new users from using the URL to join.

The client needs an additional management interface to manage URLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant