Skip to content
Back to top
View this page
Edit this page

# slidge.command.register

This module handles the registration Command, which is a necessary step for a JID to become a slidge User.

## Exceptions

`TwoFactorNotRequired` | Should be raised in `slidge.BaseGateway.validate()` if the code is not

## Classes

`RegistrationType` | An `Enum` to define the registration flow.

## Module Contents

class slidge.command.register.RegistrationType

  An `Enum` to define the registration flow.

  SINGLE_STEP_FORM = 0

    1 step, 1 form, the only flow compatible with XEP-0077. Using this, the whole flow is defined by `slidge.BaseGateway.REGISTRATION_FIELDS` and `REGISTRATION_INSTRUCTIONS`.

  QRCODE = 10

    The registration requires flashing a QR code in an official client. See `slidge.BaseGateway.send_qr()`, `get_qr_text()` and `confirm_qr()`.

  TWO_FACTOR_CODE = 20

    The registration requires confirming login with a 2FA code, eg something received by email or SMS to finalize the authentication. See `validate_two_factor_code()`.

exception slidge.command.register.TwoFactorNotRequired

  Should be raised in `slidge.BaseGateway.validate()` if the code is not required after all. This can happen for a Legacy Network where 2FA is optional.