Views

settings

View that renders the OTP configuration template. If the user does not have two-factor authentication configured, they are redirected to the setup_otp view to set it up. To access this view, the user must be logged in**.**

  • URL: /settings/2fa

  • GET: Provides the frontend with the following data: -component: OtpSettings -props: No date

setup_otp

View that provides the necessary data for the user to configure their two-factor authentication through the Otp method. To access this view, the user must be logged in**.**

  • URL: /settings/2fa/setup/otp

  • GET: Provides the frontend with the data to render: -component: OtpSetup

    • props:

    props = {
        "step": # The configuration consists of two steps. Here it is indicated in which step it is,
        "secret": # String secret of the Otp configuration required for activation
        "qr": # QR code image in base64 format
        "words": # Otp recovery words
    }
    
  • POST: Validates that the otpSettings and otp fields are correct to activate the OTP method.

remove_otp

View to remove from the user’s two-factor authentication. Then it redirects to the settings. view To access this view the user must be logged in**.**

  • URL: /settings/2fa/remove/otp

  • GET: Eliminates the registration in the user’s Otp model.

auth_otp

View to validate the otp code of a user in the user authentication process.

  • URL: /2fa/auth/otp

  • GET: Provides the frontend with the data to render: -component: OtpAuth -props: No date

  • POST: Validates the otp code entered by the user for two-factor authentication. If correct, the user is redirected to the login_view view of the accounts app. Otherwise add the error to the general inertia props.

auth_otp_recovery_words

View to validate the two-factor authentication recovery words of a user in the authentication process. To access this view, the user must be logged in.

  • URL: /2fa/auth/recovery/words

  • GET: Provides the frontend with the data to render: -component: OtpAuthWithWords -props: No date

  • POST: Validates the recovery words of the otp method of a user. If the validation is correct, the registration of the user’s otp method will be deleted and the user will be redirected to the settings view so that the user can configure the method again. Otherwise add the error to the general inertia props.

validate_otp

View accessed via ajax to perform otp code validation. To access this view, the user must be logged in.

  • URL: /2fa/verify/otp

  • POST: Validates the otp code and responds with JsonResponde the result of the validation.