Addtional Attributes for User Class

All you have to do is set the property in TSphinxConfig component:

  SphinxConfig1.UserClass := TMyUser;

And then declare your TMyUser class inheriting from TUser:

uses
  Bcl.Types.Nullable,
  Aurelius.Mapping.Attributes,
  Sphinx.Consts,
  Sphinx.Entities;

  {$RTTI EXPLICIT METHODS([vcProtected..vcPublished])}
  [Entity]
  [Model(cSphinxModelName)]
  [DiscriminatorValue('myuser')]
  TMyUser = class(TUser)
  strict private
    [Column('profile_url', [], 255)]
    FProfileUrl: NullableString;
  public
    property ProfileUrl: NullableString read FProfileUrl write FProfileUrl;
  end;

If you want to have a multi-tenant authorization server, you can also add the following unique key attribute:

  [UniqueKey('user_name, tenant_id')]
  [UniqueKey('email, tenant_id')]
  [UniqueKey('phone_number, tenant_id')]
1 Like