feat: enhance application structure and improve accessibility
- Refactor various components for better readability and maintainability. - Update HTML templates to include `alt` attributes for images and `for` attributes for labels. - Implement reactive forms in OTP component and improve token management in AuthService. - Adjust routing to redirect to 'admin/about' by default. - Remove deprecated interceptor implementation and streamline authentication logic. - Add console logs for better debugging during initialization.
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
<!-- Step 1: Enter Email -->
|
||||
@if (!isOtpSent()) {
|
||||
<form [formGroup]="emailForm" (ngSubmit)="sendOtp()" class="form-section">
|
||||
<label>Email Address</label>
|
||||
<input type="email" formControlName="email" placeholder="Enter your email" />
|
||||
<label for="email">Email Address</label>
|
||||
<input id="email" type="email" formControlName="email" placeholder="Enter your email" />
|
||||
<button type="submit" [disabled]="emailForm.invalid">Send OTP</button>
|
||||
</form>
|
||||
}
|
||||
@@ -20,8 +20,8 @@
|
||||
</p>
|
||||
|
||||
<form [formGroup]="otpForm" (ngSubmit)="verifyOtp()">
|
||||
<label>Enter 6-digit OTP</label>
|
||||
<input type="text" maxlength="6" formControlName="otp" placeholder="123456" />
|
||||
<label for="otp">Enter 6-digit OTP</label>
|
||||
<input id="otp" type="text" maxlength="6" formControlName="otp" placeholder="123456" />
|
||||
<button type="submit" [disabled]="otpForm.invalid">
|
||||
Verify OTP
|
||||
</button>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Component, inject, OnInit, signal } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { AuthService } from '../auth.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-otp',
|
||||
templateUrl: './otp.component.html',
|
||||
styleUrls: ['./otp.component.scss']
|
||||
styleUrls: ['./otp.component.scss'],
|
||||
imports: [ReactiveFormsModule, CommonModule]
|
||||
})
|
||||
export class OtpComponent implements OnInit {
|
||||
emailForm: FormGroup;
|
||||
|
||||
Reference in New Issue
Block a user