Skip to content

Console sends team invite links to /sign-in, which invited users cannot pass (2.2.0 self-hosted) #13724

Closed

Description

@JoshiJoshiJoshi

🐛 Bug Report

An invited console user cannot accept the invitation. The Console redirects the
invite link to /sign-in, but the invited user has no password to sign in with,
and signing up is rejected because the account already exists. The invite becomes
unusable, although the API endpoint behind it works without a session.

Steps to reproduce

  1. Self-hosted 2.2.0, Console image appwrite/new:1.1.101-self-hosted.
  2. Invite a new email address to the console organization
    (Organization → Members → Invite).
  3. Open the invite link: https://console.example.com/join?membershipId=…&userId=…&secret=…&teamId=…

Actual

The link redirects to /sign-in?redirect=%2Fjoin%3F…, which offers Sign in and
Sign up. Neither works:

  • Sign in — the account was created by the invite itself, with a randomly
    generated password hash
    (Memberships/Create.php):
    $hash = $proofForPassword->hash($proofForPassword->generate());
    Nobody knows that password, so there is nothing to sign in with.
  • Sign up with the same address — fails with user_already_exists, since the
    invite already created the account.

Expected

Opening the invite link confirms the membership and signs the user in, without
requiring a password — which is exactly what the API already does.

The endpoint does not need a session

PATCH /v1/teams/{teamId}/memberships/{membershipId}/status authorizes via the
secret from the link, loads the user from userId when there is no session, and
creates the session itself:

if (!$proofForToken->verify($secret, $membership->getAttribute('secret'))) {
    throw new Exception(Exception::TEAM_INVALID_SECRET);       // :102
}
$hasSession = !$targetUser->isEmpty();                          // :110
if (!$hasSession) {
    $targetUser->setAttributes($dbForProject->getDocument('users', $userId)->getArrayCopy());
}
// …
// Create session for the user if not logged in                 // :131

Verified against a live 2.2.0 instance, no session, deliberately wrong secret:

PATCH /v1/teams/<teamId>/memberships/<membershipId>/status
  header: X-Appwrite-Project: console
  body:   {"userId":"<userId>","secret":"<wrong>"}

→ 401 {"type":"team_invalid_secret", "version":"2.2.0"}

The request reaches the secret check, so the missing session is not the blocker —
with the correct secret it would have confirmed the membership. The Console UI
never calls it and asks for a login instead.

Environment

  • Appwrite 2.2.0, self-hosted, Docker Compose
  • Console image appwrite/new:1.1.101-self-hosted

Activity

  1. added
    product / auth
    product / console
    product / databases
    product / messaging
    product / self-hosted
    product / storage
    on Sep 16, 2026
  2. HarshMN2345 commented on Sep 16, 2026

    @HarshMN2345
    Member

    Thanks for checking. This is fixed in appwrite/new:1.1.107-self-hosted. Could you update the appwrite-console image again (same as last time 😅 ) and let me know if it works?

  3. JoshiJoshiJoshi commented on Sep 16, 2026

    @JoshiJoshiJoshi
    Author

    @HarshMN2345 Yeah, works fine. Thanks buddy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    product / authproduct / consoleproduct / databasesproduct / messagingproduct / self-hostedproduct / storage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions