videoflix-frontend - v0.0.0
    Preparing search index...

    Reset Password component.

    Handles password reset functionality for users who have received a reset link. Extracts reset tokens from query parameters, validates new passwords, and calls the backend service to finalize password reset.

    Features:

    • Reactive form with password validation and matching
    • Toggle password visibility for both inputs
    • Submits the new password via AuthService
    • Redirects to login after completion

    Selector: app-reset-password Standalone: true

    Index

    Constructors

    Properties

    activatedRoute: ActivatedRoute = ...

    Activated route used to extract uid and token from the query parameters.

    authService: AuthService = ...

    Authentication service for handling password reset requests.

    destroyRef: DestroyRef = ...

    Angular destroy reference (reserved for potential cleanup use).

    isResetPasswordFormSubmitted: WritableSignal<boolean> = ...

    Indicates whether the password reset form is currently being submitted.

    resetPasswordForm: FormGroup<
        {
            confirmPassword: FormControl<string | null>;
            password: FormControl<string | null>;
        },
    > = ...

    Reactive form for resetting the password.

    Controls:

    • password: required, minimum length 6
    • confirmPassword: required, minimum length 6

    Async Validators:

    • equalsToPassword: ensures both fields match
    router: Router = ...

    Router used for navigation after password reset.

    showConfirmPassword: WritableSignal<boolean> = ...

    Signal controlling confirm-password field visibility.

    showPassword: WritableSignal<boolean> = ...

    Signal controlling password field visibility.

    token: WritableSignal<string> = ...

    Signal holding password reset token extracted from the query parameters.

    uid: WritableSignal<string> = ...

    Signal holding user ID extracted from the query parameters.

    Methods

    • Submits the new password to the authentication service.

      Behavior:

      • Validates the form.
      • Sets submission loading state.
      • Sends the password reset request with uid, token, and new_password.
      • On success or error, navigates back to the login page after completion.

      Returns void

    • Toggles visibility of password or confirm password input field.

      Parameters

      • field: string

        Either 'password' or 'confirmPassword'.

      Returns void

      this.togglePasswordVisibility('password');