All checks were successful
CI / Get Changed Files (pull_request) Successful in 8s
CI / Docker backend validation (pull_request) Successful in 13s
CI / eslint (pull_request) Successful in 36s
CI / oxlint (pull_request) Successful in 31s
CI / Docker frontend validation (pull_request) Successful in 53s
CI / Checkstyle Main (pull_request) Successful in 59s
CI / prettier (pull_request) Successful in 27s
CI / test-build (pull_request) Successful in 35s
30 lines
819 B
TypeScript
30 lines
819 B
TypeScript
import { Component, inject, OnInit } from '@angular/core';
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
import { AuthService } from '@service/auth.service';
|
|
|
|
@Component({
|
|
selector: 'app-verify-email',
|
|
imports: [],
|
|
templateUrl: './verify-email.component.html',
|
|
})
|
|
export class VerifyEmailComponent implements OnInit {
|
|
route: ActivatedRoute = inject(ActivatedRoute);
|
|
router: Router = inject(Router);
|
|
authService: AuthService = inject(AuthService);
|
|
|
|
ngOnInit(): void {
|
|
const token = this.route.snapshot.queryParamMap.get('token');
|
|
|
|
if (!token) {
|
|
this.router.navigate(['']);
|
|
console.log('no token');
|
|
return;
|
|
}
|
|
|
|
this.authService.verifyEmail(token).subscribe(() => {
|
|
this.router.navigate([''], {
|
|
queryParams: { login: true },
|
|
});
|
|
});
|
|
}
|
|
}
|