Przejdź do głównej zawartości

Require an invitation code at sign-up

This guide explains how to restrict the sign-up of an application to invited users. Users then need a valid invitation code to create an account.


Learning outcomes​

  • Add the invitation code field to the sign-up form.
  • Create invitation codes for the application.

What you need​


Add the invitation code field​

  1. In the Casdoor admin console, open the edit page of the application.
  2. In Signup items, add the Invitation code item and turn on Visible and Required.
  3. Save the application.

Create invitation codes​

  1. Go to the Invitations page and add an invitation.
  2. In Application, select the application, or ALL for every application of the organization.
  3. Set the Quota, the number of times that the code can be used, and optionally an expiry time.
  4. Save the invitation and give the code or the invitation link to the user.

For all properties of an invitation, including codes that are regular expressions and invitations for a specific user, see Invitations.

Verify the result​

Open the sign-up page of the application. Sign-up succeeds only with a valid code.

Recording of a sign-up with an invitation code

wskazówka

To keep public sign-up closed while invited users can still register, turn on Disable self signup on the application. The sign-up page then accepts only invitation codes. See the Application settings reference.

See also​