Users: Invite a user by email

Open
#952 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
django, python

Research direction

Start by reading the related issues #916 and #925, then inspect the existing user creation flow, user directory filtering, and email configuration paths. The scope spans invitation tokens, password setup, admin actions, rate limits, and exclusion from several user interfaces. Done means all listed acceptance criteria pass, including expired or revoked links and unchanged manual user creation when email is unavailable.

Written by the indexing model from the issue text.

Description

module:core module:users

Context

An account is created by an administrator, who then has to hand the credentials over on some other channel. There is no invitation flow: no token, no "set your password" page, no pending state on the account. On an instance with more than a handful of users that is the onboarding path everyone trips on first.

Part of #916. Depends on #925 for the sending service.

Guest accounts (#915) will reuse this flow with a narrower account type, so the token and the landing page should not assume the invitee becomes a full member.

Scope

  • An "invite by email" action in the admin area: address, optional display name, optional groups. It creates the user with an unusable password and sends a signed, expiring link.
  • A landing page on that link where the invitee sets a password against the configured validators and is signed in.
  • Single-use token, invalidated by expiry, by activation and by revocation. Django's PasswordResetTokenGenerator or signing.TimestampSigner rather than a home-grown token.
  • The pending state is visible in the admin user list, with resend and revoke. Revoke deletes the row if the invitation was never accepted.
  • A pending invitee is not a colleague yet: excluded from user search, mentions, member pickers and the directory until the invitation is accepted. Check how the user directory filters inactive accounts before adding a flag.
  • Rate limit per inviting admin, and a cap on addresses per batch.
  • With email unconfigured the control is disabled with a reason, and the existing create-user path is unchanged.

Notes

  • The token belongs in the URL path, never in a query string that lands in access logs.
  • Addresses and tokens are user-controlled input on their way to a logger: scrub() at the call site.
  • An invitation to an address that already holds an account is a plain validation error for the admin, not a mail to the existing user.
  • The mail says who invited them and to which workspace, and nothing else the invitee has not asked for.

Acceptance criteria

  • An administrator invites someone by email; that person sets their own password from the link and lands signed in.
  • An expired, revoked or already-used link is refused with a clear message.
  • A pending invitee does not appear in user search, mentions or member pickers.
  • Resend and revoke work from the admin user list; revoke invalidates the outstanding link.
  • With no email configured, the control is disabled with a reason and creating a user by hand still works exactly as today.
Dominant language
Python
Stars
3
Forks
0
Avg merge
12h 10m
Merged PRs (30d)
197

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JaaJSoft/workspace

All issues in JaaJSoft/workspace

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.